Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pod metadata to replication controller spec template #193

Merged

Conversation

pdecat
Copy link
Contributor

@pdecat pdecat commented Oct 24, 2018

Tries to resolve #106

TODO:

  • add acceptance tests
  • add conditional logic that returns an error if both the old and new attributes are not defined to preserve the Required property of the spec fields
  • update documentation

@ghost ghost added the size/L label Oct 24, 2018
Copy link
Member

@alexsomesan alexsomesan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this fix!
I've noticed it myself when merging the Deployments PR and changed it there. This aligns things nicely.

I've got a few spot comments down below, but I think this is a nice solution overall.

metadata := expandMetadata(in["metadata"].([]interface{}))

// Add or merge labels from selector to ensure proper selection of pods by the replication controller
if metadata.Labels == nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to understand more about why you chose this approach of adding the selector labels to metadata.
I understand what you're trying to accomplish, what I'm trying to understand still is why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexsomesan I'm trying to make it backward compatible with old terraform configuration as much as possible but that's probably overkill.

The old implementation did not expose the pod template's labels field at all, it was hard-coded to reuse the replication controller selector field value.
I guessed it was done that way to enforce that managed pods had the proper set of labels and prevent bad configurations from setting inadequate labels on pods. That's probably why the metadata part of the template was not exposed in the first place.

The new implementation exposes the pod template labels but merges the selector value to keep the same guarantee of behavior.

As already stated, that's probably not needed and the merge part could be dropped.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s definitely a fact that K8S’ approach of not enforcing any sync between selectors and the labels of dependent pods is a potential cause for trouble.
While I won’t dispute that this would eliminate those failure scenarios, I am quite worried about introducing such “magic” behavior, especially this was around (selectors to pod labels). I would also like to throw in the question of doing it the other way around: sync template labels to selectors, the reasoning being that the natural way is to apply labels to pods and then craft queries to look them up. Services expose this pattern more clearly as they are not responsible for creation of target pods.

I’m interested to find out your opinion on one vs the other approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The opposite way would indeed feel more natural.
However, if it was only up to me, I'd remove the automagic behavior altogether and leave it up to the user to set the appropriate labels and selector.
Kubernetes is a fast moving target, doing the most basic mapping for all resources is already a big task, so we should probably stick to it, and not try to hide such properties.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm totally with you on that.
I think we should get rid of the "magic".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -313,6 +313,32 @@ func flattenSecretVolumeSource(in *v1.SecretVolumeSource) []interface{} {

// Expanders

func expandPodSecurityContext(l []interface{}) *v1.PodSecurityContext {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was it necessary to move this functions's code ?

If this is just cosmetic, I'd rather have it where it was for the sake of preserving git history.
Moving it around will make it harder to drill down into the history of its changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I do not remember doing that voluntarily, reverted.

Type: schema.TypeString,
Optional: true,
Computed: isComputed,
//Default: "ClusterFirst"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this is because of conflicts with Computed being set.
Let's not comment the Default out but remove it altogether.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's why.
I left it as a comment for now because I felt it was needed to preserve the same defaults for old configurations (hence the WIP in the PR title).

Perhaps this could do it:

Suggested change
//Default: "ClusterFirst"
DefaultFunc: func(isComputed bool, defaultValue interface{}) schema.SchemaDefaultFunc {
return func() (interface{}, error) {
if isComputed {
return nil, nil
}
return defaultValue, nil
}
}(isComputed, "ClusterFirst"),

What do you think?

If that makes sense, I'll move that to a named function and reuse it for the other defaults.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've committed the change, let me know what you prefer.

GNUmakefile Outdated
@@ -14,7 +14,7 @@ test: fmtcheck
xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4

testacc: fmtcheck
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 300s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why trim this timeout down?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was to fail faster in some tests, reverted.

}

// Merge deprecated fields
for k, v := range podSpecFields(true, true, true) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice transitive solution!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad you like it :)

An alternative may have been to prevent combining deprecated fields with new ones in the same configuration.

@pdecat pdecat force-pushed the fix-replication-controller-metadata branch from 49e616c to 65681ac Compare October 29, 2018 19:12
@pdecat
Copy link
Contributor Author

pdecat commented Oct 30, 2018

I guess next steps are to add acceptance tests and update documentation.

@alexsomesan
Copy link
Member

Hi @pdecat
Wanted to check quickly what's your prognosis on this. How are you doing on time?
I'm trying to decide whether to assign this PR to milestone v1.4.0

@pdecat
Copy link
Contributor Author

pdecat commented Nov 10, 2018

Hi @alexsomesan, I've just resumed working on adding acceptance tests and documentation for this one.

@pdecat pdecat force-pushed the fix-replication-controller-metadata branch from c08ff1a to fff421c Compare November 10, 2018 13:01
@pdecat
Copy link
Contributor Author

pdecat commented Nov 12, 2018

Existing acceptance tests now pass:

make testacc TEST=./kubernetes TESTARGS='-run=TestAccKubernetesReplicationController_.*'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./kubernetes -v -run=TestAccKubernetesReplicationController_.* -timeout 120m                                                                                           
=== RUN   TestAccKubernetesReplicationController_basic
--- PASS: TestAccKubernetesReplicationController_basic (112.90s)
=== RUN   TestAccKubernetesReplicationController_initContainer
--- PASS: TestAccKubernetesReplicationController_initContainer (112.87s)
=== RUN   TestAccKubernetesReplicationController_importBasic
--- PASS: TestAccKubernetesReplicationController_importBasic (112.63s)
=== RUN   TestAccKubernetesReplicationController_generatedName
--- PASS: TestAccKubernetesReplicationController_generatedName (1.11s)
=== RUN   TestAccKubernetesReplicationController_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_importGeneratedName (0.64s)
=== RUN   TestAccKubernetesReplicationController_with_security_context
--- PASS: TestAccKubernetesReplicationController_with_security_context (0.59s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec (0.70s)                                                                                       
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get                                                                                           
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get (1.14s)                                                                                   
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp (1.24s)                                                                                        
=== RUN   TestAccKubernetesReplicationController_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_with_container_lifecycle (1.28s)
=== RUN   TestAccKubernetesReplicationController_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_with_container_security_context (0.60s)
=== RUN   TestAccKubernetesReplicationController_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_with_volume_mount (0.93s)
=== RUN   TestAccKubernetesReplicationController_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_with_resource_requirements (0.66s)
=== RUN   TestAccKubernetesReplicationController_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_with_empty_dir_volume (1.13s)
PASS
ok      github.com/terraform-providers/terraform-provider-kubernetes/kubernetes 348.458s

Note: the first three tests take a long time to execute because of the high number of replicas (1000): https://github.com/terraform-providers/terraform-provider-kubernetes/blob/10bdbca189b74423e15a20c69ada689cf78ed0cd/kubernetes/resource_kubernetes_replication_controller_test.go#L483

@ghost ghost added size/XXL and removed size/L labels Nov 12, 2018
@pdecat pdecat force-pushed the fix-replication-controller-metadata branch from 899e08e to 39abf8a Compare November 12, 2018 16:39
@pdecat
Copy link
Contributor Author

pdecat commented Nov 12, 2018

Acceptance tests added but the import case is broken for the deprecated fields, not sure how to handle it yet:

make testacc TEST=./kubernetes TESTARGS='-run=TestAccKubernetesReplicationController_.*'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./kubernetes -v -run=TestAccKubernetesReplicationController_.* -timeout 120m
=== RUN   TestAccKubernetesReplicationController_deprecated_basic
--- PASS: TestAccKubernetesReplicationController_deprecated_basic (112.95s)
=== RUN   TestAccKubernetesReplicationController_deprecated_initContainer
--- PASS: TestAccKubernetesReplicationController_deprecated_initContainer (112.82s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importBasic
--- FAIL: TestAccKubernetesReplicationController_deprecated_importBasic (112.74s)
	testing.go:518: Step 1 error: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
		
		(map[string]string) (len=53) {
		 (string) (len=29) "spec.0.template.0.container.#": (string) (len=1) "0",
		 (string) (len=28) "spec.0.template.0.dns_policy": (string) "",
		 (string) (len=28) "spec.0.template.0.metadata.#": (string) (len=1) "1",
		 (string) (len=42) "spec.0.template.0.metadata.0.annotations.%": (string) (len=1) "0",
		 (string) (len=42) "spec.0.template.0.metadata.0.generate_name": (string) "",
		 (string) (len=39) "spec.0.template.0.metadata.0.generation": (string) (len=1) "0",
		 (string) (len=37) "spec.0.template.0.metadata.0.labels.%": (string) (len=1) "3",
		 (string) (len=48) "spec.0.template.0.metadata.0.labels.TestLabelOne": (string) (len=3) "one",
		 (string) (len=50) "spec.0.template.0.metadata.0.labels.TestLabelThree": (string) (len=5) "three",
		 (string) (len=48) "spec.0.template.0.metadata.0.labels.TestLabelTwo": (string) (len=3) "two",
		 (string) (len=33) "spec.0.template.0.metadata.0.name": (string) "",
		 (string) (len=38) "spec.0.template.0.metadata.0.namespace": (string) "",
		 (string) (len=45) "spec.0.template.0.metadata.0.resource_version": (string) "",
		 (string) (len=38) "spec.0.template.0.metadata.0.self_link": (string) "",
		 (string) (len=32) "spec.0.template.0.metadata.0.uid": (string) "",
		 (string) (len=32) "spec.0.template.0.restart_policy": (string) "",
		 (string) (len=24) "spec.0.template.0.spec.#": (string) (len=1) "1",
		 (string) (len=48) "spec.0.template.0.spec.0.active_deadline_seconds": (string) (len=1) "0",
		 (string) (len=36) "spec.0.template.0.spec.0.container.#": (string) (len=1) "1",
		 (string) (len=43) "spec.0.template.0.spec.0.container.0.args.#": (string) (len=1) "0",
		 (string) (len=46) "spec.0.template.0.spec.0.container.0.command.#": (string) (len=1) "0",
		 (string) (len=42) "spec.0.template.0.spec.0.container.0.env.#": (string) (len=1) "0",
		 (string) (len=47) "spec.0.template.0.spec.0.container.0.env_from.#": (string) (len=1) "0",
		 (string) (len=42) "spec.0.template.0.spec.0.container.0.image": (string) (len=11) "nginx:1.7.8",
		 (string) (len=54) "spec.0.template.0.spec.0.container.0.image_pull_policy": (string) (len=12) "IfNotPresent",
		 (string) (len=48) "spec.0.template.0.spec.0.container.0.lifecycle.#": (string) (len=1) "0",
		 (string) (len=53) "spec.0.template.0.spec.0.container.0.liveness_probe.#": (string) (len=1) "0",
		 (string) (len=41) "spec.0.template.0.spec.0.container.0.name": (string) (len=11) "tf-acc-test",
		 (string) (len=43) "spec.0.template.0.spec.0.container.0.port.#": (string) (len=1) "0",
		 (string) (len=54) "spec.0.template.0.spec.0.container.0.readiness_probe.#": (string) (len=1) "0",
		 (string) (len=48) "spec.0.template.0.spec.0.container.0.resources.#": (string) (len=1) "1",
		 (string) (len=55) "spec.0.template.0.spec.0.container.0.security_context.#": (string) (len=1) "0",
		 (string) (len=42) "spec.0.template.0.spec.0.container.0.stdin": (string) (len=5) "false",
		 (string) (len=47) "spec.0.template.0.spec.0.container.0.stdin_once": (string) (len=5) "false",
		 (string) (len=61) "spec.0.template.0.spec.0.container.0.termination_message_path": (string) (len=20) "/dev/termination-log",
		 (string) (len=40) "spec.0.template.0.spec.0.container.0.tty": (string) (len=5) "false",
		 (string) (len=51) "spec.0.template.0.spec.0.container.0.volume_mount.#": (string) (len=1) "0",
		 (string) (len=48) "spec.0.template.0.spec.0.container.0.working_dir": (string) "",
		 (string) (len=35) "spec.0.template.0.spec.0.dns_policy": (string) (len=12) "ClusterFirst",
		 (string) (len=33) "spec.0.template.0.spec.0.host_ipc": (string) (len=5) "false",
		 (string) (len=37) "spec.0.template.0.spec.0.host_network": (string) (len=5) "false",
		 (string) (len=33) "spec.0.template.0.spec.0.host_pid": (string) (len=5) "false",
		 (string) (len=33) "spec.0.template.0.spec.0.hostname": (string) "",
		 (string) (len=45) "spec.0.template.0.spec.0.image_pull_secrets.#": (string) (len=1) "0",
		 (string) (len=41) "spec.0.template.0.spec.0.init_container.#": (string) (len=1) "0",
		 (string) (len=34) "spec.0.template.0.spec.0.node_name": (string) "",
		 (string) (len=40) "spec.0.template.0.spec.0.node_selector.%": (string) (len=1) "0",
		 (string) (len=39) "spec.0.template.0.spec.0.restart_policy": (string) (len=6) "Always",
		 (string) (len=43) "spec.0.template.0.spec.0.security_context.#": (string) (len=1) "0",
		 (string) (len=45) "spec.0.template.0.spec.0.service_account_name": (string) "",
		 (string) (len=34) "spec.0.template.0.spec.0.subdomain": (string) "",
		 (string) (len=57) "spec.0.template.0.spec.0.termination_grace_period_seconds": (string) (len=1) "0",
		 (string) (len=33) "spec.0.template.0.spec.0.volume.#": (string) (len=1) "0"
		}
		
		
		(map[string]string) (len=24) {
		 (string) (len=29) "spec.0.template.0.container.#": (string) (len=1) "1",
		 (string) (len=36) "spec.0.template.0.container.0.args.#": (string) (len=1) "0",
		 (string) (len=39) "spec.0.template.0.container.0.command.#": (string) (len=1) "0",
		 (string) (len=35) "spec.0.template.0.container.0.env.#": (string) (len=1) "0",
		 (string) (len=40) "spec.0.template.0.container.0.env_from.#": (string) (len=1) "0",
		 (string) (len=35) "spec.0.template.0.container.0.image": (string) (len=11) "nginx:1.7.8",
		 (string) (len=47) "spec.0.template.0.container.0.image_pull_policy": (string) (len=12) "IfNotPresent",
		 (string) (len=41) "spec.0.template.0.container.0.lifecycle.#": (string) (len=1) "0",
		 (string) (len=46) "spec.0.template.0.container.0.liveness_probe.#": (string) (len=1) "0",
		 (string) (len=34) "spec.0.template.0.container.0.name": (string) (len=11) "tf-acc-test",
		 (string) (len=36) "spec.0.template.0.container.0.port.#": (string) (len=1) "0",
		 (string) (len=47) "spec.0.template.0.container.0.readiness_probe.#": (string) (len=1) "0",
		 (string) (len=41) "spec.0.template.0.container.0.resources.#": (string) (len=1) "1",
		 (string) (len=48) "spec.0.template.0.container.0.security_context.#": (string) (len=1) "0",
		 (string) (len=35) "spec.0.template.0.container.0.stdin": (string) (len=5) "false",
		 (string) (len=40) "spec.0.template.0.container.0.stdin_once": (string) (len=5) "false",
		 (string) (len=54) "spec.0.template.0.container.0.termination_message_path": (string) (len=20) "/dev/termination-log",
		 (string) (len=33) "spec.0.template.0.container.0.tty": (string) (len=5) "false",
		 (string) (len=44) "spec.0.template.0.container.0.volume_mount.#": (string) (len=1) "0",
		 (string) (len=41) "spec.0.template.0.container.0.working_dir": (string) "",
		 (string) (len=28) "spec.0.template.0.dns_policy": (string) (len=12) "ClusterFirst",
		 (string) (len=28) "spec.0.template.0.metadata.#": (string) (len=1) "0",
		 (string) (len=32) "spec.0.template.0.restart_policy": (string) (len=6) "Always",
		 (string) (len=24) "spec.0.template.0.spec.#": (string) (len=1) "0"
		}
		
=== RUN   TestAccKubernetesReplicationController_deprecated_generatedName
--- PASS: TestAccKubernetesReplicationController_deprecated_generatedName (1.44s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_deprecated_importGeneratedName (3.05s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_security_context (2.19s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec (1.24s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get (0.62s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp (0.61s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_lifecycle (1.24s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_security_context (0.60s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_deprecated_with_volume_mount (1.53s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_deprecated_with_resource_requirements (0.83s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume (0.63s)
=== RUN   TestAccKubernetesReplicationController_basic
--- PASS: TestAccKubernetesReplicationController_basic (113.42s)
=== RUN   TestAccKubernetesReplicationController_initContainer
--- PASS: TestAccKubernetesReplicationController_initContainer (112.80s)
=== RUN   TestAccKubernetesReplicationController_importBasic
--- PASS: TestAccKubernetesReplicationController_importBasic (112.74s)
=== RUN   TestAccKubernetesReplicationController_generatedName
--- PASS: TestAccKubernetesReplicationController_generatedName (1.29s)
=== RUN   TestAccKubernetesReplicationController_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_importGeneratedName (0.64s)
=== RUN   TestAccKubernetesReplicationController_with_security_context
--- PASS: TestAccKubernetesReplicationController_with_security_context (1.27s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec (0.63s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get (0.69s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp (0.62s)
=== RUN   TestAccKubernetesReplicationController_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_with_container_lifecycle (1.25s)
=== RUN   TestAccKubernetesReplicationController_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_with_container_security_context (1.72s)
=== RUN   TestAccKubernetesReplicationController_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_with_volume_mount (1.51s)
=== RUN   TestAccKubernetesReplicationController_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_with_resource_requirements (1.20s)
=== RUN   TestAccKubernetesReplicationController_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_with_empty_dir_volume (0.61s)
FAIL
FAIL	github.com/terraform-providers/terraform-provider-kubernetes/kubernetes	702.923s
make: *** [GNUmakefile:17: testacc] Error 1

@pdecat
Copy link
Contributor Author

pdecat commented Nov 12, 2018

Completely removed the magic on labels on the new metadata field of the replication controller template.

Deprecated importBasic test case still broken:

# make testacc TEST=./kubernetes TESTARGS='-run=TestAccKubernetesReplicationController_.*'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./kubernetes -v -run=TestAccKubernetesReplicationController_.* -timeout 120m
=== RUN   TestAccKubernetesReplicationController_deprecated_basic
--- PASS: TestAccKubernetesReplicationController_deprecated_basic (2.88s)
=== RUN   TestAccKubernetesReplicationController_deprecated_initContainer
--- PASS: TestAccKubernetesReplicationController_deprecated_initContainer (1.36s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importBasic
--- FAIL: TestAccKubernetesReplicationController_deprecated_importBasic (1.80s)
        testing.go:518: Step 1 error: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.

                (map[string]string) (len=53) {
                 (string) (len=29) "spec.0.template.0.container.#": (string) (len=1) "0",
                 (string) (len=28) "spec.0.template.0.dns_policy": (string) "",
                 (string) (len=28) "spec.0.template.0.metadata.#": (string) (len=1) "1",
                 (string) (len=42) "spec.0.template.0.metadata.0.annotations.%": (string) (len=1) "0",
                 (string) (len=42) "spec.0.template.0.metadata.0.generate_name": (string) "",
                 (string) (len=39) "spec.0.template.0.metadata.0.generation": (string) (len=1) "0",
                 (string) (len=37) "spec.0.template.0.metadata.0.labels.%": (string) (len=1) "3",
                 (string) (len=48) "spec.0.template.0.metadata.0.labels.TestLabelOne": (string) (len=3) "one",
                 (string) (len=50) "spec.0.template.0.metadata.0.labels.TestLabelThree": (string) (len=5) "three",
                 (string) (len=48) "spec.0.template.0.metadata.0.labels.TestLabelTwo": (string) (len=3) "two",
                 (string) (len=33) "spec.0.template.0.metadata.0.name": (string) "",
                 (string) (len=38) "spec.0.template.0.metadata.0.namespace": (string) "",
                 (string) (len=45) "spec.0.template.0.metadata.0.resource_version": (string) "",
                 (string) (len=38) "spec.0.template.0.metadata.0.self_link": (string) "",
                 (string) (len=32) "spec.0.template.0.metadata.0.uid": (string) "",
                 (string) (len=32) "spec.0.template.0.restart_policy": (string) "",
                 (string) (len=24) "spec.0.template.0.spec.#": (string) (len=1) "1",
                 (string) (len=48) "spec.0.template.0.spec.0.active_deadline_seconds": (string) (len=1) "0",
                 (string) (len=36) "spec.0.template.0.spec.0.container.#": (string) (len=1) "1",
                 (string) (len=43) "spec.0.template.0.spec.0.container.0.args.#": (string) (len=1) "0",
                 (string) (len=46) "spec.0.template.0.spec.0.container.0.command.#": (string) (len=1) "0",
                 (string) (len=42) "spec.0.template.0.spec.0.container.0.env.#": (string) (len=1) "0",
                 (string) (len=47) "spec.0.template.0.spec.0.container.0.env_from.#": (string) (len=1) "0",
                 (string) (len=42) "spec.0.template.0.spec.0.container.0.image": (string) (len=11) "nginx:1.7.8",
                 (string) (len=54) "spec.0.template.0.spec.0.container.0.image_pull_policy": (string) (len=12) "IfNotPresent",
                 (string) (len=48) "spec.0.template.0.spec.0.container.0.lifecycle.#": (string) (len=1) "0",
                 (string) (len=53) "spec.0.template.0.spec.0.container.0.liveness_probe.#": (string) (len=1) "0",
                 (string) (len=41) "spec.0.template.0.spec.0.container.0.name": (string) (len=11) "tf-acc-test",
                 (string) (len=43) "spec.0.template.0.spec.0.container.0.port.#": (string) (len=1) "0",
                 (string) (len=54) "spec.0.template.0.spec.0.container.0.readiness_probe.#": (string) (len=1) "0",
                 (string) (len=48) "spec.0.template.0.spec.0.container.0.resources.#": (string) (len=1) "1",
                 (string) (len=55) "spec.0.template.0.spec.0.container.0.security_context.#": (string) (len=1) "0",
                 (string) (len=42) "spec.0.template.0.spec.0.container.0.stdin": (string) (len=5) "false",
                 (string) (len=47) "spec.0.template.0.spec.0.container.0.stdin_once": (string) (len=5) "false",
                 (string) (len=61) "spec.0.template.0.spec.0.container.0.termination_message_path": (string) (len=20) "/dev/termination-log",
                 (string) (len=40) "spec.0.template.0.spec.0.container.0.tty": (string) (len=5) "false",
                 (string) (len=51) "spec.0.template.0.spec.0.container.0.volume_mount.#": (string) (len=1) "0",
                 (string) (len=48) "spec.0.template.0.spec.0.container.0.working_dir": (string) "",
                 (string) (len=35) "spec.0.template.0.spec.0.dns_policy": (string) (len=12) "ClusterFirst",
                 (string) (len=33) "spec.0.template.0.spec.0.host_ipc": (string) (len=5) "false",
                 (string) (len=37) "spec.0.template.0.spec.0.host_network": (string) (len=5) "false",
                 (string) (len=33) "spec.0.template.0.spec.0.host_pid": (string) (len=5) "false",
                 (string) (len=33) "spec.0.template.0.spec.0.hostname": (string) "",
                 (string) (len=45) "spec.0.template.0.spec.0.image_pull_secrets.#": (string) (len=1) "0",
                 (string) (len=41) "spec.0.template.0.spec.0.init_container.#": (string) (len=1) "0",
                 (string) (len=34) "spec.0.template.0.spec.0.node_name": (string) "",
                 (string) (len=40) "spec.0.template.0.spec.0.node_selector.%": (string) (len=1) "0",
                 (string) (len=39) "spec.0.template.0.spec.0.restart_policy": (string) (len=6) "Always",
                 (string) (len=43) "spec.0.template.0.spec.0.security_context.#": (string) (len=1) "0",
                 (string) (len=45) "spec.0.template.0.spec.0.service_account_name": (string) "",
                 (string) (len=34) "spec.0.template.0.spec.0.subdomain": (string) "",
                 (string) (len=57) "spec.0.template.0.spec.0.termination_grace_period_seconds": (string) (len=1) "0",
                 (string) (len=33) "spec.0.template.0.spec.0.volume.#": (string) (len=1) "0"
                }


                (map[string]string) (len=24) {
                 (string) (len=29) "spec.0.template.0.container.#": (string) (len=1) "1",
                 (string) (len=36) "spec.0.template.0.container.0.args.#": (string) (len=1) "0",
                 (string) (len=39) "spec.0.template.0.container.0.command.#": (string) (len=1) "0",
                 (string) (len=35) "spec.0.template.0.container.0.env.#": (string) (len=1) "0",
                 (string) (len=40) "spec.0.template.0.container.0.env_from.#": (string) (len=1) "0",
                 (string) (len=35) "spec.0.template.0.container.0.image": (string) (len=11) "nginx:1.7.8",
                 (string) (len=47) "spec.0.template.0.container.0.image_pull_policy": (string) (len=12) "IfNotPresent",
                 (string) (len=41) "spec.0.template.0.container.0.lifecycle.#": (string) (len=1) "0",
                 (string) (len=46) "spec.0.template.0.container.0.liveness_probe.#": (string) (len=1) "0",
                 (string) (len=34) "spec.0.template.0.container.0.name": (string) (len=11) "tf-acc-test",
                 (string) (len=36) "spec.0.template.0.container.0.port.#": (string) (len=1) "0",
                 (string) (len=47) "spec.0.template.0.container.0.readiness_probe.#": (string) (len=1) "0",
                 (string) (len=41) "spec.0.template.0.container.0.resources.#": (string) (len=1) "1",
                 (string) (len=48) "spec.0.template.0.container.0.security_context.#": (string) (len=1) "0",
                 (string) (len=35) "spec.0.template.0.container.0.stdin": (string) (len=5) "false",
                 (string) (len=40) "spec.0.template.0.container.0.stdin_once": (string) (len=5) "false",
                 (string) (len=54) "spec.0.template.0.container.0.termination_message_path": (string) (len=20) "/dev/termination-log",
                 (string) (len=33) "spec.0.template.0.container.0.tty": (string) (len=5) "false",
                 (string) (len=44) "spec.0.template.0.container.0.volume_mount.#": (string) (len=1) "0",
                 (string) (len=41) "spec.0.template.0.container.0.working_dir": (string) "",
                 (string) (len=28) "spec.0.template.0.dns_policy": (string) (len=12) "ClusterFirst",
                 (string) (len=28) "spec.0.template.0.metadata.#": (string) (len=1) "0",
                 (string) (len=32) "spec.0.template.0.restart_policy": (string) (len=6) "Always",
                 (string) (len=24) "spec.0.template.0.spec.#": (string) (len=1) "0"
                }

=== RUN   TestAccKubernetesReplicationController_deprecated_generatedName
--- PASS: TestAccKubernetesReplicationController_deprecated_generatedName (1.52s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_deprecated_importGeneratedName (0.63s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_security_context (1.19s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec (0.62s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get (1.29s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp (1.25s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_lifecycle (1.80s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_security_context (1.23s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_deprecated_with_volume_mount (1.59s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_deprecated_with_resource_requirements (0.60s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume (1.30s)
=== RUN   TestAccKubernetesReplicationController_basic
--- PASS: TestAccKubernetesReplicationController_basic (2.12s)
=== RUN   TestAccKubernetesReplicationController_initContainer
--- PASS: TestAccKubernetesReplicationController_initContainer (1.90s)
=== RUN   TestAccKubernetesReplicationController_importBasic
--- PASS: TestAccKubernetesReplicationController_importBasic (1.79s)
=== RUN   TestAccKubernetesReplicationController_generatedName
--- PASS: TestAccKubernetesReplicationController_generatedName (1.18s)
=== RUN   TestAccKubernetesReplicationController_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_importGeneratedName (0.74s)
=== RUN   TestAccKubernetesReplicationController_with_security_context
--- PASS: TestAccKubernetesReplicationController_with_security_context (0.63s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec (0.66s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get (1.27s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp (0.63s)
=== RUN   TestAccKubernetesReplicationController_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_with_container_lifecycle (1.28s)
=== RUN   TestAccKubernetesReplicationController_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_with_container_security_context (1.26s)
=== RUN   TestAccKubernetesReplicationController_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_with_volume_mount (1.46s)
=== RUN   TestAccKubernetesReplicationController_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_with_resource_requirements (1.23s)
=== RUN   TestAccKubernetesReplicationController_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_with_empty_dir_volume (1.22s)
FAIL
FAIL    github.com/terraform-providers/terraform-provider-kubernetes/kubernetes 36.456s
make: *** [GNUmakefile:17: testacc] Error 1

@pdecat
Copy link
Contributor Author

pdecat commented Nov 14, 2018

There was an issue with the TestAccKubernetesReplicationController_deprecated_importGeneratedName test case that incorrectly used the non deprecated configuration that made it pass, while it shouldn't.

It now fails just like the other TestAccKubernetesReplicationController_deprecated_importBasic test case:

# make testacc TEST=./kubernetes TESTARGS='-run=TestAccKubernetesReplicationController_.*'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./kubernetes -v -run=TestAccKubernetesReplicationController_.* -timeout 120m
=== RUN   TestAccKubernetesReplicationController_deprecated_basic
--- PASS: TestAccKubernetesReplicationController_deprecated_basic (2.31s)
=== RUN   TestAccKubernetesReplicationController_deprecated_initContainer
--- PASS: TestAccKubernetesReplicationController_deprecated_initContainer (1.82s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importBasic
--- FAIL: TestAccKubernetesReplicationController_deprecated_importBasic (1.86s)
	testing.go:518: Step 1 error: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
		
		(map[string]string) (len=53) {
		 (string) (len=29) "spec.0.template.0.container.#": (string) (len=1) "0",
		 (string) (len=28) "spec.0.template.0.dns_policy": (string) "",
		 (string) (len=28) "spec.0.template.0.metadata.#": (string) (len=1) "1",
		 (string) (len=42) "spec.0.template.0.metadata.0.annotations.%": (string) (len=1) "0",
		 (string) (len=42) "spec.0.template.0.metadata.0.generate_name": (string) "",
		 (string) (len=39) "spec.0.template.0.metadata.0.generation": (string) (len=1) "0",
		 (string) (len=37) "spec.0.template.0.metadata.0.labels.%": (string) (len=1) "3",
		 (string) (len=48) "spec.0.template.0.metadata.0.labels.TestLabelOne": (string) (len=3) "one",
		 (string) (len=50) "spec.0.template.0.metadata.0.labels.TestLabelThree": (string) (len=5) "three",
		 (string) (len=48) "spec.0.template.0.metadata.0.labels.TestLabelTwo": (string) (len=3) "two",
		 (string) (len=33) "spec.0.template.0.metadata.0.name": (string) "",
		 (string) (len=38) "spec.0.template.0.metadata.0.namespace": (string) "",
		 (string) (len=45) "spec.0.template.0.metadata.0.resource_version": (string) "",
		 (string) (len=38) "spec.0.template.0.metadata.0.self_link": (string) "",
		 (string) (len=32) "spec.0.template.0.metadata.0.uid": (string) "",
		 (string) (len=32) "spec.0.template.0.restart_policy": (string) "",
		 (string) (len=24) "spec.0.template.0.spec.#": (string) (len=1) "1",
		 (string) (len=48) "spec.0.template.0.spec.0.active_deadline_seconds": (string) (len=1) "0",
		 (string) (len=36) "spec.0.template.0.spec.0.container.#": (string) (len=1) "1",
		 (string) (len=43) "spec.0.template.0.spec.0.container.0.args.#": (string) (len=1) "0",
		 (string) (len=46) "spec.0.template.0.spec.0.container.0.command.#": (string) (len=1) "0",
		 (string) (len=42) "spec.0.template.0.spec.0.container.0.env.#": (string) (len=1) "0",
		 (string) (len=47) "spec.0.template.0.spec.0.container.0.env_from.#": (string) (len=1) "0",
		 (string) (len=42) "spec.0.template.0.spec.0.container.0.image": (string) (len=11) "nginx:1.7.8",
		 (string) (len=54) "spec.0.template.0.spec.0.container.0.image_pull_policy": (string) (len=12) "IfNotPresent",
		 (string) (len=48) "spec.0.template.0.spec.0.container.0.lifecycle.#": (string) (len=1) "0",
		 (string) (len=53) "spec.0.template.0.spec.0.container.0.liveness_probe.#": (string) (len=1) "0",
		 (string) (len=41) "spec.0.template.0.spec.0.container.0.name": (string) (len=11) "tf-acc-test",
		 (string) (len=43) "spec.0.template.0.spec.0.container.0.port.#": (string) (len=1) "0",
		 (string) (len=54) "spec.0.template.0.spec.0.container.0.readiness_probe.#": (string) (len=1) "0",
		 (string) (len=48) "spec.0.template.0.spec.0.container.0.resources.#": (string) (len=1) "1",
		 (string) (len=55) "spec.0.template.0.spec.0.container.0.security_context.#": (string) (len=1) "0",
		 (string) (len=42) "spec.0.template.0.spec.0.container.0.stdin": (string) (len=5) "false",
		 (string) (len=47) "spec.0.template.0.spec.0.container.0.stdin_once": (string) (len=5) "false",
		 (string) (len=61) "spec.0.template.0.spec.0.container.0.termination_message_path": (string) (len=20) "/dev/termination-log",
		 (string) (len=40) "spec.0.template.0.spec.0.container.0.tty": (string) (len=5) "false",
		 (string) (len=51) "spec.0.template.0.spec.0.container.0.volume_mount.#": (string) (len=1) "0",
		 (string) (len=48) "spec.0.template.0.spec.0.container.0.working_dir": (string) "",
		 (string) (len=35) "spec.0.template.0.spec.0.dns_policy": (string) (len=12) "ClusterFirst",
		 (string) (len=33) "spec.0.template.0.spec.0.host_ipc": (string) (len=5) "false",
		 (string) (len=37) "spec.0.template.0.spec.0.host_network": (string) (len=5) "false",
		 (string) (len=33) "spec.0.template.0.spec.0.host_pid": (string) (len=5) "false",
		 (string) (len=33) "spec.0.template.0.spec.0.hostname": (string) "",
		 (string) (len=45) "spec.0.template.0.spec.0.image_pull_secrets.#": (string) (len=1) "0",
		 (string) (len=41) "spec.0.template.0.spec.0.init_container.#": (string) (len=1) "0",
		 (string) (len=34) "spec.0.template.0.spec.0.node_name": (string) "",
		 (string) (len=40) "spec.0.template.0.spec.0.node_selector.%": (string) (len=1) "0",
		 (string) (len=39) "spec.0.template.0.spec.0.restart_policy": (string) (len=6) "Always",
		 (string) (len=43) "spec.0.template.0.spec.0.security_context.#": (string) (len=1) "0",
		 (string) (len=45) "spec.0.template.0.spec.0.service_account_name": (string) "",
		 (string) (len=34) "spec.0.template.0.spec.0.subdomain": (string) "",
		 (string) (len=57) "spec.0.template.0.spec.0.termination_grace_period_seconds": (string) (len=1) "0",
		 (string) (len=33) "spec.0.template.0.spec.0.volume.#": (string) (len=1) "0"
		}
		
		
		(map[string]string) (len=24) {
		 (string) (len=29) "spec.0.template.0.container.#": (string) (len=1) "1",
		 (string) (len=36) "spec.0.template.0.container.0.args.#": (string) (len=1) "0",
		 (string) (len=39) "spec.0.template.0.container.0.command.#": (string) (len=1) "0",
		 (string) (len=35) "spec.0.template.0.container.0.env.#": (string) (len=1) "0",
		 (string) (len=40) "spec.0.template.0.container.0.env_from.#": (string) (len=1) "0",
		 (string) (len=35) "spec.0.template.0.container.0.image": (string) (len=11) "nginx:1.7.8",
		 (string) (len=47) "spec.0.template.0.container.0.image_pull_policy": (string) (len=12) "IfNotPresent",
		 (string) (len=41) "spec.0.template.0.container.0.lifecycle.#": (string) (len=1) "0",
		 (string) (len=46) "spec.0.template.0.container.0.liveness_probe.#": (string) (len=1) "0",
		 (string) (len=34) "spec.0.template.0.container.0.name": (string) (len=11) "tf-acc-test",
		 (string) (len=36) "spec.0.template.0.container.0.port.#": (string) (len=1) "0",
		 (string) (len=47) "spec.0.template.0.container.0.readiness_probe.#": (string) (len=1) "0",
		 (string) (len=41) "spec.0.template.0.container.0.resources.#": (string) (len=1) "1",
		 (string) (len=48) "spec.0.template.0.container.0.security_context.#": (string) (len=1) "0",
		 (string) (len=35) "spec.0.template.0.container.0.stdin": (string) (len=5) "false",
		 (string) (len=40) "spec.0.template.0.container.0.stdin_once": (string) (len=5) "false",
		 (string) (len=54) "spec.0.template.0.container.0.termination_message_path": (string) (len=20) "/dev/termination-log",
		 (string) (len=33) "spec.0.template.0.container.0.tty": (string) (len=5) "false",
		 (string) (len=44) "spec.0.template.0.container.0.volume_mount.#": (string) (len=1) "0",
		 (string) (len=41) "spec.0.template.0.container.0.working_dir": (string) "",
		 (string) (len=28) "spec.0.template.0.dns_policy": (string) (len=12) "ClusterFirst",
		 (string) (len=28) "spec.0.template.0.metadata.#": (string) (len=1) "0",
		 (string) (len=32) "spec.0.template.0.restart_policy": (string) (len=6) "Always",
		 (string) (len=24) "spec.0.template.0.spec.#": (string) (len=1) "0"
		}
		
=== RUN   TestAccKubernetesReplicationController_deprecated_generatedName
--- PASS: TestAccKubernetesReplicationController_deprecated_generatedName (1.16s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importGeneratedName
--- FAIL: TestAccKubernetesReplicationController_deprecated_importGeneratedName (1.18s)
	testing.go:518: Step 1 error: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
		
		(map[string]string) (len=53) {
		 (string) (len=29) "spec.0.template.0.container.#": (string) (len=1) "0",
		 (string) (len=28) "spec.0.template.0.dns_policy": (string) "",
		 (string) (len=28) "spec.0.template.0.metadata.#": (string) (len=1) "1",
		 (string) (len=42) "spec.0.template.0.metadata.0.annotations.%": (string) (len=1) "0",
		 (string) (len=42) "spec.0.template.0.metadata.0.generate_name": (string) "",
		 (string) (len=39) "spec.0.template.0.metadata.0.generation": (string) (len=1) "0",
		 (string) (len=37) "spec.0.template.0.metadata.0.labels.%": (string) (len=1) "3",
		 (string) (len=48) "spec.0.template.0.metadata.0.labels.TestLabelOne": (string) (len=3) "one",
		 (string) (len=50) "spec.0.template.0.metadata.0.labels.TestLabelThree": (string) (len=5) "three",
		 (string) (len=48) "spec.0.template.0.metadata.0.labels.TestLabelTwo": (string) (len=3) "two",
		 (string) (len=33) "spec.0.template.0.metadata.0.name": (string) "",
		 (string) (len=38) "spec.0.template.0.metadata.0.namespace": (string) "",
		 (string) (len=45) "spec.0.template.0.metadata.0.resource_version": (string) "",
		 (string) (len=38) "spec.0.template.0.metadata.0.self_link": (string) "",
		 (string) (len=32) "spec.0.template.0.metadata.0.uid": (string) "",
		 (string) (len=32) "spec.0.template.0.restart_policy": (string) "",
		 (string) (len=24) "spec.0.template.0.spec.#": (string) (len=1) "1",
		 (string) (len=48) "spec.0.template.0.spec.0.active_deadline_seconds": (string) (len=1) "0",
		 (string) (len=36) "spec.0.template.0.spec.0.container.#": (string) (len=1) "1",
		 (string) (len=43) "spec.0.template.0.spec.0.container.0.args.#": (string) (len=1) "0",
		 (string) (len=46) "spec.0.template.0.spec.0.container.0.command.#": (string) (len=1) "0",
		 (string) (len=42) "spec.0.template.0.spec.0.container.0.env.#": (string) (len=1) "0",
		 (string) (len=47) "spec.0.template.0.spec.0.container.0.env_from.#": (string) (len=1) "0",
		 (string) (len=42) "spec.0.template.0.spec.0.container.0.image": (string) (len=11) "nginx:1.7.9",
		 (string) (len=54) "spec.0.template.0.spec.0.container.0.image_pull_policy": (string) (len=12) "IfNotPresent",
		 (string) (len=48) "spec.0.template.0.spec.0.container.0.lifecycle.#": (string) (len=1) "0",
		 (string) (len=53) "spec.0.template.0.spec.0.container.0.liveness_probe.#": (string) (len=1) "0",
		 (string) (len=41) "spec.0.template.0.spec.0.container.0.name": (string) (len=11) "tf-acc-test",
		 (string) (len=43) "spec.0.template.0.spec.0.container.0.port.#": (string) (len=1) "0",
		 (string) (len=54) "spec.0.template.0.spec.0.container.0.readiness_probe.#": (string) (len=1) "0",
		 (string) (len=48) "spec.0.template.0.spec.0.container.0.resources.#": (string) (len=1) "1",
		 (string) (len=55) "spec.0.template.0.spec.0.container.0.security_context.#": (string) (len=1) "0",
		 (string) (len=42) "spec.0.template.0.spec.0.container.0.stdin": (string) (len=5) "false",
		 (string) (len=47) "spec.0.template.0.spec.0.container.0.stdin_once": (string) (len=5) "false",
		 (string) (len=61) "spec.0.template.0.spec.0.container.0.termination_message_path": (string) (len=20) "/dev/termination-log",
		 (string) (len=40) "spec.0.template.0.spec.0.container.0.tty": (string) (len=5) "false",
		 (string) (len=51) "spec.0.template.0.spec.0.container.0.volume_mount.#": (string) (len=1) "0",
		 (string) (len=48) "spec.0.template.0.spec.0.container.0.working_dir": (string) "",
		 (string) (len=35) "spec.0.template.0.spec.0.dns_policy": (string) (len=12) "ClusterFirst",
		 (string) (len=33) "spec.0.template.0.spec.0.host_ipc": (string) (len=5) "false",
		 (string) (len=37) "spec.0.template.0.spec.0.host_network": (string) (len=5) "false",
		 (string) (len=33) "spec.0.template.0.spec.0.host_pid": (string) (len=5) "false",
		 (string) (len=33) "spec.0.template.0.spec.0.hostname": (string) "",
		 (string) (len=45) "spec.0.template.0.spec.0.image_pull_secrets.#": (string) (len=1) "0",
		 (string) (len=41) "spec.0.template.0.spec.0.init_container.#": (string) (len=1) "0",
		 (string) (len=34) "spec.0.template.0.spec.0.node_name": (string) "",
		 (string) (len=40) "spec.0.template.0.spec.0.node_selector.%": (string) (len=1) "0",
		 (string) (len=39) "spec.0.template.0.spec.0.restart_policy": (string) (len=6) "Always",
		 (string) (len=43) "spec.0.template.0.spec.0.security_context.#": (string) (len=1) "0",
		 (string) (len=45) "spec.0.template.0.spec.0.service_account_name": (string) "",
		 (string) (len=34) "spec.0.template.0.spec.0.subdomain": (string) "",
		 (string) (len=57) "spec.0.template.0.spec.0.termination_grace_period_seconds": (string) (len=1) "0",
		 (string) (len=33) "spec.0.template.0.spec.0.volume.#": (string) (len=1) "0"
		}
		
		
		(map[string]string) (len=24) {
		 (string) (len=29) "spec.0.template.0.container.#": (string) (len=1) "1",
		 (string) (len=36) "spec.0.template.0.container.0.args.#": (string) (len=1) "0",
		 (string) (len=39) "spec.0.template.0.container.0.command.#": (string) (len=1) "0",
		 (string) (len=35) "spec.0.template.0.container.0.env.#": (string) (len=1) "0",
		 (string) (len=40) "spec.0.template.0.container.0.env_from.#": (string) (len=1) "0",
		 (string) (len=35) "spec.0.template.0.container.0.image": (string) (len=11) "nginx:1.7.9",
		 (string) (len=47) "spec.0.template.0.container.0.image_pull_policy": (string) (len=12) "IfNotPresent",
		 (string) (len=41) "spec.0.template.0.container.0.lifecycle.#": (string) (len=1) "0",
		 (string) (len=46) "spec.0.template.0.container.0.liveness_probe.#": (string) (len=1) "0",
		 (string) (len=34) "spec.0.template.0.container.0.name": (string) (len=11) "tf-acc-test",
		 (string) (len=36) "spec.0.template.0.container.0.port.#": (string) (len=1) "0",
		 (string) (len=47) "spec.0.template.0.container.0.readiness_probe.#": (string) (len=1) "0",
		 (string) (len=41) "spec.0.template.0.container.0.resources.#": (string) (len=1) "1",
		 (string) (len=48) "spec.0.template.0.container.0.security_context.#": (string) (len=1) "0",
		 (string) (len=35) "spec.0.template.0.container.0.stdin": (string) (len=5) "false",
		 (string) (len=40) "spec.0.template.0.container.0.stdin_once": (string) (len=5) "false",
		 (string) (len=54) "spec.0.template.0.container.0.termination_message_path": (string) (len=20) "/dev/termination-log",
		 (string) (len=33) "spec.0.template.0.container.0.tty": (string) (len=5) "false",
		 (string) (len=44) "spec.0.template.0.container.0.volume_mount.#": (string) (len=1) "0",
		 (string) (len=41) "spec.0.template.0.container.0.working_dir": (string) "",
		 (string) (len=28) "spec.0.template.0.dns_policy": (string) (len=12) "ClusterFirst",
		 (string) (len=28) "spec.0.template.0.metadata.#": (string) (len=1) "0",
		 (string) (len=32) "spec.0.template.0.restart_policy": (string) (len=6) "Always",
		 (string) (len=24) "spec.0.template.0.spec.#": (string) (len=1) "0"
		}
		
=== RUN   TestAccKubernetesReplicationController_deprecated_with_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_security_context (1.37s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec (0.58s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get (0.59s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp (0.58s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_lifecycle (1.90s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_security_context (0.71s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_deprecated_with_volume_mount (2.03s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_deprecated_with_resource_requirements (0.59s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume (1.52s)
=== RUN   TestAccKubernetesReplicationController_basic
--- PASS: TestAccKubernetesReplicationController_basic (3.04s)
=== RUN   TestAccKubernetesReplicationController_initContainer
--- PASS: TestAccKubernetesReplicationController_initContainer (1.80s)
=== RUN   TestAccKubernetesReplicationController_importBasic
--- PASS: TestAccKubernetesReplicationController_importBasic (1.75s)
=== RUN   TestAccKubernetesReplicationController_generatedName
--- PASS: TestAccKubernetesReplicationController_generatedName (1.61s)
=== RUN   TestAccKubernetesReplicationController_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_importGeneratedName (1.33s)
=== RUN   TestAccKubernetesReplicationController_with_security_context
--- PASS: TestAccKubernetesReplicationController_with_security_context (0.62s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec (1.26s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get (0.61s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp (1.16s)
=== RUN   TestAccKubernetesReplicationController_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_with_container_lifecycle (1.15s)
=== RUN   TestAccKubernetesReplicationController_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_with_container_security_context (1.30s)
=== RUN   TestAccKubernetesReplicationController_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_with_volume_mount (1.12s)
=== RUN   TestAccKubernetesReplicationController_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_with_resource_requirements (1.46s)
=== RUN   TestAccKubernetesReplicationController_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_with_empty_dir_volume (1.35s)
FAIL
FAIL	github.com/terraform-providers/terraform-provider-kubernetes/kubernetes	37.810s
make: *** [GNUmakefile:17: testacc] Error 1

I did not manage to implement a more effective detection of whether the target resource configuration is using the old/deprecated template spec fields or the new ones.
The GetOkExists() function, which seems to be the most appropriate one for this use case does not work in the import cases as the corresponding state is empty.

I'm wondering if the import to deprecated fields test case should be dropped altogether with a note in the documentation stating that the new fields should be used for import.

Still digging...

@pdecat
Copy link
Contributor Author

pdecat commented Nov 14, 2018

Apparently, it wouldn't be the first case where import is supposed to only target the new attributes in case of renaming: https://github.com/terraform-providers/terraform-provider-aws/pull/5586/files

@pdecat pdecat force-pushed the fix-replication-controller-metadata branch from b8032f5 to 8628222 Compare November 14, 2018 08:52
@pdecat
Copy link
Contributor Author

pdecat commented Nov 14, 2018

Hi @alexsomesan, I've disabled the state verification for import test cases where the deprecated template pod spec fields are used.

All acceptance tests now pass:

# make testacc TEST=./kubernetes TESTARGS='-run=TestAccKubernetesReplicationController_.*'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./kubernetes -v -run=TestAccKubernetesReplicationController_.* -timeout 120m
=== RUN   TestAccKubernetesReplicationController_deprecated_basic
--- PASS: TestAccKubernetesReplicationController_deprecated_basic (114.85s)
=== RUN   TestAccKubernetesReplicationController_deprecated_initContainer
--- PASS: TestAccKubernetesReplicationController_deprecated_initContainer (113.47s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importBasic
--- PASS: TestAccKubernetesReplicationController_deprecated_importBasic (114.14s)
=== RUN   TestAccKubernetesReplicationController_deprecated_generatedName
--- PASS: TestAccKubernetesReplicationController_deprecated_generatedName (1.36s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_deprecated_importGeneratedName (1.63s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_security_context (1.38s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec (0.92s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get (1.52s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp (0.96s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_lifecycle (3.53s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_security_context (1.32s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_deprecated_with_volume_mount (2.02s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_deprecated_with_resource_requirements (0.83s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume (1.73s)
=== RUN   TestAccKubernetesReplicationController_basic
--- PASS: TestAccKubernetesReplicationController_basic (115.11s)
=== RUN   TestAccKubernetesReplicationController_initContainer
--- PASS: TestAccKubernetesReplicationController_initContainer (114.02s)
=== RUN   TestAccKubernetesReplicationController_importBasic
--- PASS: TestAccKubernetesReplicationController_importBasic (114.28s)
=== RUN   TestAccKubernetesReplicationController_generatedName
--- PASS: TestAccKubernetesReplicationController_generatedName (0.71s)
=== RUN   TestAccKubernetesReplicationController_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_importGeneratedName (1.45s)
=== RUN   TestAccKubernetesReplicationController_with_security_context
--- PASS: TestAccKubernetesReplicationController_with_security_context (0.93s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec (2.05s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get (1.73s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp (1.51s)
=== RUN   TestAccKubernetesReplicationController_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_with_container_lifecycle (2.68s)
=== RUN   TestAccKubernetesReplicationController_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_with_container_security_context (1.66s)
=== RUN   TestAccKubernetesReplicationController_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_with_volume_mount (2.06s)
=== RUN   TestAccKubernetesReplicationController_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_with_resource_requirements (1.32s)
=== RUN   TestAccKubernetesReplicationController_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_with_empty_dir_volume (1.08s)
PASS
ok  	github.com/terraform-providers/terraform-provider-kubernetes/kubernetes	720.273s

If that's ok for you, I'll proceed and update the documentation accordingly.

@alexsomesan
Copy link
Member

Hi @pdecat! Sorry, I haven't had a second deep look at this change as I was focusing on getting StatefulSets out of the way.
Going through your recent changes now.

@pdecat
Copy link
Contributor Author

pdecat commented Nov 30, 2018

Hi @alexsomesan, what's your take on this? Should I proceed and update the documentation to match the current implementation?

@pdecat
Copy link
Contributor Author

pdecat commented Nov 30, 2018

Note: I'm currently fixing the conflicts related to terraform acceptance tests formatting.

Checking out https://github.com/katbyte/terrafmt

@pdecat pdecat force-pushed the fix-replication-controller-metadata branch from 8628222 to 17e5337 Compare November 30, 2018 10:51
@pdecat
Copy link
Contributor Author

pdecat commented Nov 30, 2018

Rebased on master.

Following are acceptance tests with GKE 1.11.3-gke.18 network policies and VPC-native.

Replication Controller tests all pass:

# make testacc TEST=./kubernetes TESTARGS='-run=TestAccKubernetesReplicationController_.* -count=1'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./kubernetes -v -run=TestAccKubernetesReplicationController_.* -count=1 -timeout 120m
=== RUN   TestAccKubernetesReplicationController_deprecated_basic
--- PASS: TestAccKubernetesReplicationController_deprecated_basic (116.52s)
=== RUN   TestAccKubernetesReplicationController_deprecated_initContainer
--- PASS: TestAccKubernetesReplicationController_deprecated_initContainer (115.03s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importBasic
--- PASS: TestAccKubernetesReplicationController_deprecated_importBasic (115.07s)
=== RUN   TestAccKubernetesReplicationController_deprecated_generatedName
--- PASS: TestAccKubernetesReplicationController_deprecated_generatedName (1.69s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_deprecated_importGeneratedName (1.73s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_security_context (1.63s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec (1.61s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get (1.69s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp (1.75s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_lifecycle (1.70s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_security_context (1.65s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_deprecated_with_volume_mount (2.56s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_deprecated_with_resource_requirements (1.72s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume (1.64s)
=== RUN   TestAccKubernetesReplicationController_basic
--- PASS: TestAccKubernetesReplicationController_basic (116.41s)
=== RUN   TestAccKubernetesReplicationController_initContainer
--- PASS: TestAccKubernetesReplicationController_initContainer (115.13s)
=== RUN   TestAccKubernetesReplicationController_importBasic
--- PASS: TestAccKubernetesReplicationController_importBasic (115.27s)
=== RUN   TestAccKubernetesReplicationController_generatedName
--- PASS: TestAccKubernetesReplicationController_generatedName (1.67s)
=== RUN   TestAccKubernetesReplicationController_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_importGeneratedName (1.90s)
=== RUN   TestAccKubernetesReplicationController_with_security_context
--- PASS: TestAccKubernetesReplicationController_with_security_context (1.69s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec (1.63s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get (1.65s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp (1.74s)
=== RUN   TestAccKubernetesReplicationController_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_with_container_lifecycle (1.86s)
=== RUN   TestAccKubernetesReplicationController_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_with_container_security_context (1.62s)
=== RUN   TestAccKubernetesReplicationController_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_with_volume_mount (2.56s)
=== RUN   TestAccKubernetesReplicationController_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_with_resource_requirements (1.81s)
=== RUN   TestAccKubernetesReplicationController_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_with_empty_dir_volume (1.90s)
PASS
ok      github.com/terraform-providers/terraform-provider-kubernetes/kubernetes 732.877s

@pdecat
Copy link
Contributor Author

pdecat commented Nov 30, 2018

Oh no, new conflicts :(

@pdecat pdecat force-pushed the fix-replication-controller-metadata branch from 17e5337 to 6b60d04 Compare November 30, 2018 15:33
@pdecat
Copy link
Contributor Author

pdecat commented Nov 30, 2018

Rebased on master.

Following are acceptance tests with GKE 1.11.3-gke.18 network policies and VPC-native.

Replication Controller tests all pass:

make testacc TEST=./kubernetes TESTARGS='-run=TestAccKubernetesReplicationController_.* -count=1'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./kubernetes -v -run=TestAccKubernetesReplicationController_.* -count=1 -timeout 120m
=== RUN   TestAccKubernetesReplicationController_deprecated_basic
--- PASS: TestAccKubernetesReplicationController_deprecated_basic (117.30s)
=== RUN   TestAccKubernetesReplicationController_deprecated_initContainer
--- PASS: TestAccKubernetesReplicationController_deprecated_initContainer (115.66s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importBasic
--- PASS: TestAccKubernetesReplicationController_deprecated_importBasic (116.86s)
=== RUN   TestAccKubernetesReplicationController_deprecated_generatedName
--- PASS: TestAccKubernetesReplicationController_deprecated_generatedName (2.02s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_deprecated_importGeneratedName (2.63s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_security_context (1.91s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec (1.97s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get (1.86s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp (1.81s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_lifecycle (1.85s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_security_context (2.25s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_deprecated_with_volume_mount (3.20s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_deprecated_with_resource_requirements (2.06s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume (2.02s)
=== RUN   TestAccKubernetesReplicationController_basic
--- PASS: TestAccKubernetesReplicationController_basic (116.78s)
=== RUN   TestAccKubernetesReplicationController_initContainer
--- PASS: TestAccKubernetesReplicationController_initContainer (115.45s)
=== RUN   TestAccKubernetesReplicationController_importBasic
--- PASS: TestAccKubernetesReplicationController_importBasic (115.45s)
=== RUN   TestAccKubernetesReplicationController_generatedName
--- PASS: TestAccKubernetesReplicationController_generatedName (2.76s)
=== RUN   TestAccKubernetesReplicationController_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_importGeneratedName (2.14s)
=== RUN   TestAccKubernetesReplicationController_with_security_context
--- PASS: TestAccKubernetesReplicationController_with_security_context (1.92s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec (1.96s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get (1.95s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp (2.10s)
=== RUN   TestAccKubernetesReplicationController_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_with_container_lifecycle (1.80s)
=== RUN   TestAccKubernetesReplicationController_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_with_container_security_context (1.89s)
=== RUN   TestAccKubernetesReplicationController_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_with_volume_mount (3.11s)
=== RUN   TestAccKubernetesReplicationController_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_with_resource_requirements (1.90s)
=== RUN   TestAccKubernetesReplicationController_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_with_empty_dir_volume (1.95s)
PASS
ok      github.com/terraform-providers/terraform-provider-kubernetes/kubernetes 744.624s

@alexsomesan
Copy link
Member

@pdecat I'll do another review of this later today.

@pdecat
Copy link
Contributor Author

pdecat commented Nov 30, 2018

Currently looking into the two remaining unchecked items.

@pdecat
Copy link
Contributor Author

pdecat commented Nov 30, 2018

FYI, I launched a complete run of acceptance tests and some are failing:

# make testacc TEST=./kubernetes TESTARGS='-run=TestAccKubernetes.* -count=1'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./kubernetes -v -run=TestAccKubernetes.* -count=1 -timeout 120m
=== RUN   TestAccKubernetesDataSourceService_basic
--- PASS: TestAccKubernetesDataSourceService_basic (1.78s)
=== RUN   TestAccKubernetesDataSourceStorageClass_basic
--- PASS: TestAccKubernetesDataSourceStorageClass_basic (1.47s)
=== RUN   TestAccKubernetesClusterRoleBinding
--- PASS: TestAccKubernetesClusterRoleBinding (2.22s)
=== RUN   TestAccKubernetesClusterRoleBinding_importBasic
--- PASS: TestAccKubernetesClusterRoleBinding_importBasic (1.42s)
=== RUN   TestAccKubernetesConfigMap_basic
--- PASS: TestAccKubernetesConfigMap_basic (3.99s)
=== RUN   TestAccKubernetesConfigMap_importBasic
--- PASS: TestAccKubernetesConfigMap_importBasic (1.34s)
=== RUN   TestAccKubernetesConfigMap_generatedName
--- PASS: TestAccKubernetesConfigMap_generatedName (1.25s)
=== RUN   TestAccKubernetesConfigMap_importGeneratedName
--- PASS: TestAccKubernetesConfigMap_importGeneratedName (1.34s)
=== RUN   TestAccKubernetesDeployment_basic
--- PASS: TestAccKubernetesDeployment_basic (78.51s)
=== RUN   TestAccKubernetesDeployment_initContainer
--- PASS: TestAccKubernetesDeployment_initContainer (128.95s)
=== RUN   TestAccKubernetesDeployment_importBasic
--- PASS: TestAccKubernetesDeployment_importBasic (129.29s)
=== RUN   TestAccKubernetesDeployment_generatedName
--- PASS: TestAccKubernetesDeployment_generatedName (17.59s)
=== RUN   TestAccKubernetesDeployment_importGeneratedName
--- PASS: TestAccKubernetesDeployment_importGeneratedName (58.09s)
=== RUN   TestAccKubernetesDeployment_with_security_context
--- FAIL: TestAccKubernetesDeployment_with_security_context (600.76s)
        testing.go:518: Step 0 error: Error applying: 1 error(s) occurred:

                * kubernetes_deployment.test: 1 error(s) occurred:

                * kubernetes_deployment.test: Waiting for rollout to finish: 0 of 1 updated replicas are available...
=== RUN   TestAccKubernetesDeployment_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesDeployment_with_container_liveness_probe_using_exec (3.17s)
=== RUN   TestAccKubernetesDeployment_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesDeployment_with_container_liveness_probe_using_http_get (3.14s)
=== RUN   TestAccKubernetesDeployment_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesDeployment_with_container_liveness_probe_using_tcp (3.09s)
=== RUN   TestAccKubernetesDeployment_with_container_lifecycle
--- FAIL: TestAccKubernetesDeployment_with_container_lifecycle (600.76s)
        testing.go:518: Step 0 error: Error applying: 1 error(s) occurred:

                * kubernetes_deployment.test: 1 error(s) occurred:

                * kubernetes_deployment.test: Waiting for rollout to finish: 0 of 1 updated replicas are available...
=== RUN   TestAccKubernetesDeployment_with_container_security_context
--- FAIL: TestAccKubernetesDeployment_with_container_security_context (601.02s)
        testing.go:518: Step 0 error: Error applying: 1 error(s) occurred:

                * kubernetes_deployment.test: 1 error(s) occurred:

                * kubernetes_deployment.test: Waiting for rollout to finish: 0 of 1 updated replicas are available...
=== RUN   TestAccKubernetesDeployment_with_volume_mount
--- PASS: TestAccKubernetesDeployment_with_volume_mount (4.08s)
=== RUN   TestAccKubernetesDeployment_with_resource_requirements
--- PASS: TestAccKubernetesDeployment_with_resource_requirements (2.08s)
=== RUN   TestAccKubernetesDeployment_with_empty_dir_volume
--- PASS: TestAccKubernetesDeployment_with_empty_dir_volume (3.12s)
=== RUN   TestAccKubernetesDeploymentUpdate_basic
--- PASS: TestAccKubernetesDeploymentUpdate_basic (136.24s)
=== RUN   TestAccKubernetesHorizontalPodAutoscaler_basic
--- PASS: TestAccKubernetesHorizontalPodAutoscaler_basic (3.17s)
=== RUN   TestAccKubernetesHorizontalPodAutoscaler_generatedName
--- PASS: TestAccKubernetesHorizontalPodAutoscaler_generatedName (1.24s)
=== RUN   TestAccKubernetesHorizontalPodAutoscaler_importBasic
--- PASS: TestAccKubernetesHorizontalPodAutoscaler_importBasic (1.37s)
=== RUN   TestAccKubernetesLimitRange_basic
--- PASS: TestAccKubernetesLimitRange_basic (3.15s)
=== RUN   TestAccKubernetesLimitRange_empty
--- PASS: TestAccKubernetesLimitRange_empty (1.24s)
=== RUN   TestAccKubernetesLimitRange_generatedName
--- PASS: TestAccKubernetesLimitRange_generatedName (1.29s)
=== RUN   TestAccKubernetesLimitRange_typeChange
--- PASS: TestAccKubernetesLimitRange_typeChange (2.14s)
=== RUN   TestAccKubernetesLimitRange_multipleLimits
--- PASS: TestAccKubernetesLimitRange_multipleLimits (1.23s)
=== RUN   TestAccKubernetesLimitRange_importBasic
--- PASS: TestAccKubernetesLimitRange_importBasic (1.33s)
=== RUN   TestAccKubernetesNamespace_basic
--- PASS: TestAccKubernetesNamespace_basic (11.83s)
=== RUN   TestAccKubernetesNamespace_invalidLabelValueType
--- PASS: TestAccKubernetesNamespace_invalidLabelValueType (0.02s)
=== RUN   TestAccKubernetesNamespace_importBasic
--- PASS: TestAccKubernetesNamespace_importBasic (8.26s)
=== RUN   TestAccKubernetesNamespace_generatedName
--- PASS: TestAccKubernetesNamespace_generatedName (8.12s)
=== RUN   TestAccKubernetesNamespace_withSpecialCharacters
--- PASS: TestAccKubernetesNamespace_withSpecialCharacters (8.17s)
=== RUN   TestAccKubernetesNamespace_importGeneratedName
--- PASS: TestAccKubernetesNamespace_importGeneratedName (8.25s)
=== RUN   TestAccKubernetesPersistentVolumeClaim_basic
--- PASS: TestAccKubernetesPersistentVolumeClaim_basic (4.34s)
=== RUN   TestAccKubernetesPersistentVolumeClaim_googleCloud_importBasic
--- FAIL: TestAccKubernetesPersistentVolumeClaim_googleCloud_importBasic (0.30s)
        testing.go:518: Step 0 error: Error applying: 1 error(s) occurred:

                * google_compute_disk.test: 1 error(s) occurred:

                * google_compute_disk.test: Error loading zone 'us-east1-b': Get https://www.googleapis.com/compute/v1/projects/cloudpublic-sandbox/zones/us-east1-b?alt=json: oauth2: ca
nnot fetch token: 400 Bad Request
                Response: {
                  "error": "invalid_grant",
                  "error_description": "Bad Request"
                }
=== RUN   TestAccKubernetesPersistentVolumeClaim_googleCloud_volumeMatch
--- FAIL: TestAccKubernetesPersistentVolumeClaim_googleCloud_volumeMatch (0.16s)
        testing.go:518: Step 0 error: Error applying: 1 error(s) occurred:

                * google_compute_disk.test: 1 error(s) occurred:

                * google_compute_disk.test: Error loading zone 'us-east1-b': Get https://www.googleapis.com/compute/v1/projects/cloudpublic-sandbox/zones/us-east1-b?alt=json: oauth2: ca
nnot fetch token: 400 Bad Request
                Response: {
                  "error": "invalid_grant",
                  "error_description": "Bad Request"
                }
=== RUN   TestAccKubernetesPersistentVolumeClaim_googleCloud_volumeUpdate
--- FAIL: TestAccKubernetesPersistentVolumeClaim_googleCloud_volumeUpdate (0.13s)
        testing.go:518: Step 0 error: Error applying: 1 error(s) occurred:

                * google_compute_disk.test: 1 error(s) occurred:

                * google_compute_disk.test: Error loading zone 'us-east1-b': Get https://www.googleapis.com/compute/v1/projects/cloudpublic-sandbox/zones/us-east1-b?alt=json: oauth2: ca
nnot fetch token: 400 Bad Request
                Response: {
                  "error": "invalid_grant",
                  "error_description": "Bad Request"
                }
=== RUN   TestAccKubernetesPersistentVolumeClaim_googleCloud_storageClass
--- PASS: TestAccKubernetesPersistentVolumeClaim_googleCloud_storageClass (11.39s)
=== RUN   TestAccKubernetesPersistentVolume_googleCloud_basic
--- FAIL: TestAccKubernetesPersistentVolume_googleCloud_basic (0.13s)
        testing.go:518: Step 0 error: Error applying: 1 error(s) occurred:

                * google_compute_disk.test: 1 error(s) occurred:

                * google_compute_disk.test: Error loading zone 'us-east1-b': Get https://www.googleapis.com/compute/v1/projects/cloudpublic-sandbox/zones/us-east1-b?alt=json: oauth2: ca
nnot fetch token: 400 Bad Request
                Response: {
                  "error": "invalid_grant",
                  "error_description": "Bad Request"
                }
=== RUN   TestAccKubernetesPersistentVolume_aws_basic
--- SKIP: TestAccKubernetesPersistentVolume_aws_basic (0.00s)
        provider_test.go:195: The environment variables AWS_DEFAULT_REGION, AWS_ZONE, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY must be set to run AWS tests - skipping
=== RUN   TestAccKubernetesPersistentVolume_googleCloud_importBasic
--- FAIL: TestAccKubernetesPersistentVolume_googleCloud_importBasic (0.09s)
        testing.go:518: Step 0 error: Error applying: 1 error(s) occurred:

                * google_compute_disk.test: 1 error(s) occurred:

                * google_compute_disk.test: Error loading zone 'us-east1-b': Get https://www.googleapis.com/compute/v1/projects/cloudpublic-sandbox/zones/us-east1-b?alt=json: oauth2: ca
nnot fetch token: 400 Bad Request
                Response: {
                  "error": "invalid_grant",
                  "error_description": "Bad Request"
                }
=== RUN   TestAccKubernetesPersistentVolume_googleCloud_volumeSource
--- FAIL: TestAccKubernetesPersistentVolume_googleCloud_volumeSource (0.15s)
        testing.go:518: Step 0 error: Error applying: 1 error(s) occurred:

                * google_compute_disk.test: 1 error(s) occurred:

                * google_compute_disk.test: Error loading zone 'us-east1-b': Get https://www.googleapis.com/compute/v1/projects/cloudpublic-sandbox/zones/us-east1-b?alt=json: oauth2: ca
nnot fetch token: 400 Bad Request
                Response: {
                  "error": "invalid_grant",
                  "error_description": "Bad Request"
                }
=== RUN   TestAccKubernetesPersistentVolume_hostPath_volumeSource
--- PASS: TestAccKubernetesPersistentVolume_hostPath_volumeSource (3.21s)
=== RUN   TestAccKubernetesPersistentVolume_cephFsSecretRef
--- PASS: TestAccKubernetesPersistentVolume_cephFsSecretRef (1.62s)
=== RUN   TestAccKubernetesPersistentVolume_storageClass
--- FAIL: TestAccKubernetesPersistentVolume_storageClass (0.78s)
        testing.go:518: Step 0 error: Error applying: 1 error(s) occurred:

                * google_compute_disk.test: 1 error(s) occurred:

                * google_compute_disk.test: Error loading zone 'us-east1-b': Get https://www.googleapis.com/compute/v1/projects/cloudpublic-sandbox/zones/us-east1-b?alt=json: oauth2: ca
nnot fetch token: 400 Bad Request
                Response: {
                  "error": "invalid_grant",
                  "error_description": "Bad Request"
                }
=== RUN   TestAccKubernetesPod_basic
--- FAIL: TestAccKubernetesPod_basic (16.95s)
        testing.go:518: Step 0 error: Check failed: 1 error(s) occurred:

                * Check 2/21 error: kubernetes_pod.test: Attribute 'metadata.0.annotations.%' expected "0", got "1"
=== RUN   TestAccKubernetesPod_initContainer_updateForcesNew
--- FAIL: TestAccKubernetesPod_initContainer_updateForcesNew (18.40s)
        testing.go:518: Step 0 error: Check failed: 1 error(s) occurred:

                * Check 2/13 error: kubernetes_pod.test: Attribute 'metadata.0.annotations.%' expected "0", got "1"
=== RUN   TestAccKubernetesPod_updateArgsForceNew
--- FAIL: TestAccKubernetesPod_updateArgsForceNew (41.07s)
        testing.go:518: Step 0 error: Check failed: 1 error(s) occurred:

                * Check 2/12 error: kubernetes_pod.test: Attribute 'metadata.0.annotations.%' expected "0", got "1"
=== RUN   TestAccKubernetesPod_updateEnvForceNew
--- FAIL: TestAccKubernetesPod_updateEnvForceNew (6.83s)
        testing.go:518: Step 0 error: Check failed: 1 error(s) occurred:

                * Check 2/12 error: kubernetes_pod.test: Attribute 'metadata.0.annotations.%' expected "0", got "1"
=== RUN   TestAccKubernetesPod_importBasic
--- FAIL: TestAccKubernetesPod_importBasic (5.91s)
        testing.go:518: Step 0 error: After applying this step, the plan was not empty:

                DIFF:

                UPDATE: kubernetes_pod.test
                  metadata.0.annotations.%:                           "1" => "0"
                  metadata.0.annotations.cni.projectcalico.org/podIP: "10.156.1.56/32" => ""

                STATE:

                kubernetes_pod.test:
                  ID = default/tf-acc-test-j7jmm1nw1z
                  provider = provider.kubernetes
                  metadata.# = 1
                  metadata.0.annotations.% = 1
                  metadata.0.annotations.cni.projectcalico.org/podIP = 10.156.1.56/32
                  metadata.0.generate_name =
                  metadata.0.generation = 0
                  metadata.0.labels.% = 1
                  metadata.0.labels.app = pod_label
                  metadata.0.name = tf-acc-test-j7jmm1nw1z
                  metadata.0.namespace = default
                  metadata.0.resource_version = 184207
                  metadata.0.self_link = /api/v1/namespaces/default/pods/tf-acc-test-j7jmm1nw1z
                  metadata.0.uid = 56629483-f4c3-11e8-b7c4-42010a8e0010
                  spec.# = 1
                  spec.0.active_deadline_seconds = 0
                  spec.0.container.# = 1
                  spec.0.container.0.args.# = 0
                  spec.0.container.0.command.# = 0
                  spec.0.container.0.env.# = 0
                  spec.0.container.0.env_from.# = 0
                  spec.0.container.0.image = nginx:1.7.9
                  spec.0.container.0.image_pull_policy = IfNotPresent
                  spec.0.container.0.lifecycle.# = 0
                  spec.0.container.0.liveness_probe.# = 0
                  spec.0.container.0.name = containername
                  spec.0.container.0.port.# = 0
                  spec.0.container.0.readiness_probe.# = 0
                  spec.0.container.0.resources.# = 1
                  spec.0.container.0.resources.0.limits.# = 0
                  spec.0.container.0.resources.0.requests.# = 1
                  spec.0.container.0.resources.0.requests.0.cpu = 100m
                  spec.0.container.0.resources.0.requests.0.memory =
                  spec.0.container.0.security_context.# = 0
                  spec.0.container.0.stdin = false
                  spec.0.container.0.stdin_once = false
                  spec.0.container.0.termination_message_path = /dev/termination-log
                  spec.0.container.0.tty = false
                  spec.0.container.0.volume_mount.# = 0
                  spec.0.container.0.working_dir =
                  spec.0.dns_policy = ClusterFirst
                  spec.0.host_ipc = false
                  spec.0.host_network = false
                  spec.0.host_pid = false
                  spec.0.hostname =
                  spec.0.image_pull_secrets.# = 0
                  spec.0.init_container.# = 0
                  spec.0.node_name = gke-pdecat-terraform-kub-default-pool-81f2e275-9jq1
                  spec.0.node_selector.% = 0
                  spec.0.restart_policy = Always
                  spec.0.security_context.# = 1
                  spec.0.security_context.0.fs_group = 0
                  spec.0.security_context.0.run_as_non_root = true
                  spec.0.security_context.0.run_as_user = 101
                  spec.0.security_context.0.se_linux_options.# = 0
                  spec.0.security_context.0.supplemental_groups.# = 1
                  spec.0.security_context.0.supplemental_groups.988695518 = 101
                  spec.0.service_account_name = default
                  spec.0.subdomain =
                  spec.0.termination_grace_period_seconds = 30
                  spec.0.volume.# = 0
=== RUN   TestAccKubernetesPod_with_pod_security_context
--- FAIL: TestAccKubernetesPod_with_pod_security_context (5.93s)
        testing.go:518: Step 0 error: After applying this step, the plan was not empty:

                DIFF:

                UPDATE: kubernetes_pod.test
                  metadata.0.annotations.%:                           "1" => "0"
                  metadata.0.annotations.cni.projectcalico.org/podIP: "10.156.2.69/32" => ""

                STATE:

                kubernetes_pod.test:
                  ID = default/tf-acc-test-3a1ophae4s
                  provider = provider.kubernetes
                  metadata.# = 1
                  metadata.0.annotations.% = 1
                  metadata.0.annotations.cni.projectcalico.org/podIP = 10.156.2.69/32
                  metadata.0.generate_name =
                  metadata.0.generation = 0
                  metadata.0.labels.% = 1
                  metadata.0.labels.app = pod_label
                  metadata.0.name = tf-acc-test-3a1ophae4s
                  metadata.0.namespace = default
                  metadata.0.resource_version = 184239
                  metadata.0.self_link = /api/v1/namespaces/default/pods/tf-acc-test-3a1ophae4s
                  metadata.0.uid = 59ea8f3e-f4c3-11e8-b7c4-42010a8e0010
                  spec.# = 1
                  spec.0.active_deadline_seconds = 0
                  spec.0.container.# = 1
                  spec.0.container.0.args.# = 0
                  spec.0.container.0.command.# = 0
                  spec.0.container.0.env.# = 0
                  spec.0.container.0.env_from.# = 0
                  spec.0.container.0.image = nginx:1.7.9
                  spec.0.container.0.image_pull_policy = IfNotPresent
                  spec.0.container.0.lifecycle.# = 0
                  spec.0.container.0.liveness_probe.# = 0
                  spec.0.container.0.name = containername
                  spec.0.container.0.port.# = 0
                  spec.0.container.0.readiness_probe.# = 0
                  spec.0.container.0.resources.# = 1
                  spec.0.container.0.resources.0.limits.# = 0
                  spec.0.container.0.resources.0.requests.# = 1
                  spec.0.container.0.resources.0.requests.0.cpu = 100m
                  spec.0.container.0.resources.0.requests.0.memory =
                  spec.0.container.0.security_context.# = 0
                  spec.0.container.0.stdin = false
                  spec.0.container.0.stdin_once = false
                  spec.0.container.0.termination_message_path = /dev/termination-log
                  spec.0.container.0.tty = false
                  spec.0.container.0.volume_mount.# = 0
                  spec.0.container.0.working_dir =
                  spec.0.dns_policy = ClusterFirst
                  spec.0.host_ipc = false
                  spec.0.host_network = false
                  spec.0.host_pid = false
                  spec.0.hostname =
                  spec.0.image_pull_secrets.# = 0
                  spec.0.init_container.# = 0
                  spec.0.node_name = gke-pdecat-terraform-kub-default-pool-42c34e65-7s78
                  spec.0.node_selector.% = 0
                  spec.0.restart_policy = Always
                  spec.0.security_context.# = 1
                  spec.0.security_context.0.fs_group = 0
                  spec.0.security_context.0.run_as_non_root = true
                  spec.0.security_context.0.run_as_user = 101
                  spec.0.security_context.0.se_linux_options.# = 0
                  spec.0.security_context.0.supplemental_groups.# = 1
                  spec.0.security_context.0.supplemental_groups.988695518 = 101
                  spec.0.service_account_name = default
                  spec.0.subdomain =
                  spec.0.termination_grace_period_seconds = 30
                  spec.0.volume.# = 0
=== RUN   TestAccKubernetesPod_with_container_liveness_probe_using_exec
--- FAIL: TestAccKubernetesPod_with_container_liveness_probe_using_exec (48.57s)
        testing.go:518: Step 0 error: After applying this step, the plan was not empty:

                DIFF:

                UPDATE: kubernetes_pod.test
                  metadata.0.annotations.%:                           "1" => "0"
                  metadata.0.annotations.cni.projectcalico.org/podIP: "10.156.0.159/32" => ""

                STATE:

                kubernetes_pod.test:
                  ID = default/tf-acc-test-wpc0sicwzy
                  provider = provider.kubernetes
                  metadata.# = 1
                  metadata.0.annotations.% = 1
                  metadata.0.annotations.cni.projectcalico.org/podIP = 10.156.0.159/32
                  metadata.0.generate_name =
                  metadata.0.generation = 0
                  metadata.0.labels.% = 1
                  metadata.0.labels.app = pod_label
                  metadata.0.name = tf-acc-test-wpc0sicwzy
                  metadata.0.namespace = default
                  metadata.0.resource_version = 184271
                  metadata.0.self_link = /api/v1/namespaces/default/pods/tf-acc-test-wpc0sicwzy
                  metadata.0.uid = 5d722f41-f4c3-11e8-b7c4-42010a8e0010
                  spec.# = 1
                  spec.0.active_deadline_seconds = 0
                  spec.0.container.# = 1
                  spec.0.container.0.args.# = 3
                  spec.0.container.0.args.0 = /bin/sh
                  spec.0.container.0.args.1 = -c
                  spec.0.container.0.args.2 = touch /tmp/healthy; sleep 300; rm -rf /tmp/healthy; sleep 600
                  spec.0.container.0.command.# = 0
                  spec.0.container.0.env.# = 0
                  spec.0.container.0.env_from.# = 0
                  spec.0.container.0.image = gcr.io/google_containers/busybox
                  spec.0.container.0.image_pull_policy = Always
                  spec.0.container.0.lifecycle.# = 0
                  spec.0.container.0.liveness_probe.# = 1
                  spec.0.container.0.liveness_probe.0.exec.# = 1
                  spec.0.container.0.liveness_probe.0.exec.0.command.# = 2
                  spec.0.container.0.liveness_probe.0.exec.0.command.0 = cat
                  spec.0.container.0.liveness_probe.0.exec.0.command.1 = /tmp/healthy
                  spec.0.container.0.liveness_probe.0.failure_threshold = 3
                  spec.0.container.0.liveness_probe.0.http_get.# = 0
                  spec.0.container.0.liveness_probe.0.initial_delay_seconds = 5
                  spec.0.container.0.liveness_probe.0.period_seconds = 5
                  spec.0.container.0.liveness_probe.0.success_threshold = 1
                  spec.0.container.0.liveness_probe.0.tcp_socket.# = 0
                  spec.0.container.0.liveness_probe.0.timeout_seconds = 1
                  spec.0.container.0.name = containername
                  spec.0.container.0.port.# = 0
                  spec.0.container.0.readiness_probe.# = 0
                  spec.0.container.0.resources.# = 1
                  spec.0.container.0.resources.0.limits.# = 0
                  spec.0.container.0.resources.0.requests.# = 1
                  spec.0.container.0.resources.0.requests.0.cpu = 100m
                  spec.0.container.0.resources.0.requests.0.memory =
                  spec.0.container.0.security_context.# = 0
                  spec.0.container.0.stdin = false
                  spec.0.container.0.stdin_once = false
                  spec.0.container.0.termination_message_path = /dev/termination-log
                  spec.0.container.0.tty = false
                  spec.0.container.0.volume_mount.# = 0
                  spec.0.container.0.working_dir =
                  spec.0.dns_policy = ClusterFirst
                  spec.0.host_ipc = false
                  spec.0.host_network = false
                  spec.0.host_pid = false
                  spec.0.hostname =
                  spec.0.image_pull_secrets.# = 0
                  spec.0.init_container.# = 0
                  spec.0.node_name = gke-pdecat-terraform-kub-default-pool-318bb3a5-18dn
                  spec.0.node_selector.% = 0
                  spec.0.restart_policy = Always
                  spec.0.security_context.# = 0
                  spec.0.service_account_name = default
                  spec.0.subdomain =
                  spec.0.termination_grace_period_seconds = 30
                  spec.0.volume.# = 0
=== RUN   TestAccKubernetesPod_with_container_liveness_probe_using_http_get
--- FAIL: TestAccKubernetesPod_with_container_liveness_probe_using_http_get (18.27s)
        testing.go:518: Step 0 error: After applying this step, the plan was not empty:

                DIFF:

                UPDATE: kubernetes_pod.test
                  metadata.0.annotations.%:                           "1" => "0"
                  metadata.0.annotations.cni.projectcalico.org/podIP: "10.156.1.58/32" => ""

                STATE:

                kubernetes_pod.test:
                  ID = default/tf-acc-test-qawxy9idog
                  provider = provider.kubernetes
                  metadata.# = 1
                  metadata.0.annotations.% = 1
                  metadata.0.annotations.cni.projectcalico.org/podIP = 10.156.1.58/32
                  metadata.0.generate_name =
                  metadata.0.generation = 0
                  metadata.0.labels.% = 1
                  metadata.0.labels.app = pod_label
                  metadata.0.name = tf-acc-test-qawxy9idog
                  metadata.0.namespace = default
                  metadata.0.resource_version = 184436
                  metadata.0.self_link = /api/v1/namespaces/default/pods/tf-acc-test-qawxy9idog
                  metadata.0.uid = 7a685e6d-f4c3-11e8-b7c4-42010a8e0010
                  spec.# = 1
                  spec.0.active_deadline_seconds = 0
                  spec.0.container.# = 1
                  spec.0.container.0.args.# = 1
                  spec.0.container.0.args.0 = /server
                  spec.0.container.0.command.# = 0
                  spec.0.container.0.env.# = 0
                  spec.0.container.0.env_from.# = 0
                  spec.0.container.0.image = gcr.io/google_containers/liveness
                  spec.0.container.0.image_pull_policy = Always
                  spec.0.container.0.lifecycle.# = 0
                  spec.0.container.0.liveness_probe.# = 1
                  spec.0.container.0.liveness_probe.0.exec.# = 0
                  spec.0.container.0.liveness_probe.0.failure_threshold = 3
                  spec.0.container.0.liveness_probe.0.http_get.# = 1
                  spec.0.container.0.liveness_probe.0.http_get.0.host =
                  spec.0.container.0.liveness_probe.0.http_get.0.http_header.# = 1
                  spec.0.container.0.liveness_probe.0.http_get.0.http_header.0.name = X-Custom-Header
                  spec.0.container.0.liveness_probe.0.http_get.0.http_header.0.value = Awesome
                  spec.0.container.0.liveness_probe.0.http_get.0.path = /healthz
                  spec.0.container.0.liveness_probe.0.http_get.0.port = 8080
                  spec.0.container.0.liveness_probe.0.http_get.0.scheme = HTTP
                  spec.0.container.0.liveness_probe.0.initial_delay_seconds = 3
                  spec.0.container.0.liveness_probe.0.period_seconds = 3
                  spec.0.container.0.liveness_probe.0.success_threshold = 1
                  spec.0.container.0.liveness_probe.0.tcp_socket.# = 0
                  spec.0.container.0.liveness_probe.0.timeout_seconds = 1
                  spec.0.container.0.name = containername
                  spec.0.container.0.port.# = 0
                  spec.0.container.0.readiness_probe.# = 0
                  spec.0.container.0.resources.# = 1
                  spec.0.container.0.resources.0.limits.# = 0
                  spec.0.container.0.resources.0.requests.# = 1
                  spec.0.container.0.resources.0.requests.0.cpu = 100m
                  spec.0.container.0.resources.0.requests.0.memory =
                  spec.0.container.0.security_context.# = 0
                  spec.0.container.0.stdin = false
                  spec.0.container.0.stdin_once = false
                  spec.0.container.0.termination_message_path = /dev/termination-log
                  spec.0.container.0.tty = false
                  spec.0.container.0.volume_mount.# = 0
                  spec.0.container.0.working_dir =
                  spec.0.dns_policy = ClusterFirst
                  spec.0.host_ipc = false
                  spec.0.host_network = false
                  spec.0.host_pid = false
                  spec.0.hostname =
                  spec.0.image_pull_secrets.# = 0
                  spec.0.init_container.# = 0
                  spec.0.node_name = gke-pdecat-terraform-kub-default-pool-81f2e275-9jq1
                  spec.0.node_selector.% = 0
                  spec.0.restart_policy = Always
                  spec.0.security_context.# = 0
                  spec.0.service_account_name = default
                  spec.0.subdomain =
                  spec.0.termination_grace_period_seconds = 30
                  spec.0.volume.# = 0
=== RUN   TestAccKubernetesPod_with_container_liveness_probe_using_tcp
--- FAIL: TestAccKubernetesPod_with_container_liveness_probe_using_tcp (18.40s)
        testing.go:518: Step 0 error: After applying this step, the plan was not empty:

                DIFF:

                UPDATE: kubernetes_pod.test
                  metadata.0.annotations.%:                           "1" => "0"
                  metadata.0.annotations.cni.projectcalico.org/podIP: "10.156.2.71/32" => ""

                STATE:

                kubernetes_pod.test:
                  ID = default/tf-acc-test-bstxbs0gfk
                  provider = provider.kubernetes
                  metadata.# = 1
                  metadata.0.annotations.% = 1
                  metadata.0.annotations.cni.projectcalico.org/podIP = 10.156.2.71/32
                  metadata.0.generate_name =
                  metadata.0.generation = 0
                  metadata.0.labels.% = 1
                  metadata.0.labels.app = pod_label
                  metadata.0.name = tf-acc-test-bstxbs0gfk
                  metadata.0.namespace = default
                  metadata.0.resource_version = 184505
                  metadata.0.self_link = /api/v1/namespaces/default/pods/tf-acc-test-bstxbs0gfk
                  metadata.0.uid = 8548e6e5-f4c3-11e8-b7c4-42010a8e0010
                  spec.# = 1
                  spec.0.active_deadline_seconds = 0
                  spec.0.container.# = 1
                  spec.0.container.0.args.# = 1
                  spec.0.container.0.args.0 = /server
                  spec.0.container.0.command.# = 0
                  spec.0.container.0.env.# = 0
                  spec.0.container.0.env_from.# = 0
                  spec.0.container.0.image = gcr.io/google_containers/liveness
                  spec.0.container.0.image_pull_policy = Always
                  spec.0.container.0.lifecycle.# = 0
                  spec.0.container.0.liveness_probe.# = 1
                  spec.0.container.0.liveness_probe.0.exec.# = 0
                  spec.0.container.0.liveness_probe.0.failure_threshold = 3
                  spec.0.container.0.liveness_probe.0.http_get.# = 0
                  spec.0.container.0.liveness_probe.0.initial_delay_seconds = 3
                  spec.0.container.0.liveness_probe.0.period_seconds = 3
                  spec.0.container.0.liveness_probe.0.success_threshold = 1
                  spec.0.container.0.liveness_probe.0.tcp_socket.# = 1
                  spec.0.container.0.liveness_probe.0.tcp_socket.0.port = 8080
                  spec.0.container.0.liveness_probe.0.timeout_seconds = 1
                  spec.0.container.0.name = containername
                  spec.0.container.0.port.# = 0
                  spec.0.container.0.readiness_probe.# = 0
                  spec.0.container.0.resources.# = 1
                  spec.0.container.0.resources.0.limits.# = 0
                  spec.0.container.0.resources.0.requests.# = 1
                  spec.0.container.0.resources.0.requests.0.cpu = 100m
                  spec.0.container.0.resources.0.requests.0.memory =
                  spec.0.container.0.security_context.# = 0
                  spec.0.container.0.stdin = false
                  spec.0.container.0.stdin_once = false
                  spec.0.container.0.termination_message_path = /dev/termination-log
                  spec.0.container.0.tty = false
                  spec.0.container.0.volume_mount.# = 0
                  spec.0.container.0.working_dir =
                  spec.0.dns_policy = ClusterFirst
                  spec.0.host_ipc = false
                  spec.0.host_network = false
                  spec.0.host_pid = false
                  spec.0.hostname =
                  spec.0.image_pull_secrets.# = 0
                  spec.0.init_container.# = 0
                  spec.0.node_name = gke-pdecat-terraform-kub-default-pool-42c34e65-7s78
                  spec.0.node_selector.% = 0
                  spec.0.restart_policy = Always
                  spec.0.security_context.# = 0
                  spec.0.service_account_name = default
                  spec.0.subdomain =
                  spec.0.termination_grace_period_seconds = 30
                  spec.0.volume.# = 0
=== RUN   TestAccKubernetesPod_with_container_lifecycle
--- FAIL: TestAccKubernetesPod_with_container_lifecycle (6.92s)
        testing.go:518: Step 0 error: After applying this step, the plan was not empty:

                DIFF:

                UPDATE: kubernetes_pod.test
                  metadata.0.annotations.%:                           "1" => "0"
                  metadata.0.annotations.cni.projectcalico.org/podIP: "10.156.0.160/32" => ""

                STATE:

                kubernetes_pod.test:
                  ID = default/tf-acc-test-urymoe9goo
                  provider = provider.kubernetes
                  metadata.# = 1
                  metadata.0.annotations.% = 1
                  metadata.0.annotations.cni.projectcalico.org/podIP = 10.156.0.160/32
                  metadata.0.generate_name =
                  metadata.0.generation = 0
                  metadata.0.labels.% = 1
                  metadata.0.labels.app = pod_label
                  metadata.0.name = tf-acc-test-urymoe9goo
                  metadata.0.namespace = default
                  metadata.0.resource_version = 184577
                  metadata.0.self_link = /api/v1/namespaces/default/pods/tf-acc-test-urymoe9goo
                  metadata.0.uid = 90414cb8-f4c3-11e8-b7c4-42010a8e0010
                  spec.# = 1
                  spec.0.active_deadline_seconds = 0
                  spec.0.container.# = 1
                  spec.0.container.0.args.# = 1
                  spec.0.container.0.args.0 = /server
                  spec.0.container.0.command.# = 0
                  spec.0.container.0.env.# = 0
                  spec.0.container.0.env_from.# = 0
                  spec.0.container.0.image = gcr.io/google_containers/liveness
                  spec.0.container.0.image_pull_policy = Always
                  spec.0.container.0.lifecycle.# = 1
                  spec.0.container.0.lifecycle.0.post_start.# = 1
                  spec.0.container.0.lifecycle.0.post_start.0.exec.# = 1
                  spec.0.container.0.lifecycle.0.post_start.0.exec.0.command.# = 2
                  spec.0.container.0.lifecycle.0.post_start.0.exec.0.command.0 = ls
                  spec.0.container.0.lifecycle.0.post_start.0.exec.0.command.1 = -al
                  spec.0.container.0.lifecycle.0.post_start.0.http_get.# = 0
                  spec.0.container.0.lifecycle.0.post_start.0.tcp_socket.# = 0
                  spec.0.container.0.lifecycle.0.pre_stop.# = 1
                  spec.0.container.0.lifecycle.0.pre_stop.0.exec.# = 1
                  spec.0.container.0.lifecycle.0.pre_stop.0.exec.0.command.# = 1
                  spec.0.container.0.lifecycle.0.pre_stop.0.exec.0.command.0 = date
                  spec.0.container.0.lifecycle.0.pre_stop.0.http_get.# = 0
                  spec.0.container.0.lifecycle.0.pre_stop.0.tcp_socket.# = 0
                  spec.0.container.0.liveness_probe.# = 0
                  spec.0.container.0.name = containername
                  spec.0.container.0.port.# = 0
                  spec.0.container.0.readiness_probe.# = 0
                  spec.0.container.0.resources.# = 1
                  spec.0.container.0.resources.0.limits.# = 0
                  spec.0.container.0.resources.0.requests.# = 1
                  spec.0.container.0.resources.0.requests.0.cpu = 100m
                  spec.0.container.0.resources.0.requests.0.memory =
                  spec.0.container.0.security_context.# = 0
                  spec.0.container.0.stdin = false
                  spec.0.container.0.stdin_once = false
                  spec.0.container.0.termination_message_path = /dev/termination-log
                  spec.0.container.0.tty = false
                  spec.0.container.0.volume_mount.# = 0
                  spec.0.container.0.working_dir =
                  spec.0.dns_policy = ClusterFirst
                  spec.0.host_ipc = false
                  spec.0.host_network = false
                  spec.0.host_pid = false
                  spec.0.hostname =
                  spec.0.image_pull_secrets.# = 0
                  spec.0.init_container.# = 0
                  spec.0.node_name = gke-pdecat-terraform-kub-default-pool-318bb3a5-18dn
                  spec.0.node_selector.% = 0
                  spec.0.restart_policy = Always
                  spec.0.security_context.# = 0
                  spec.0.service_account_name = default
                  spec.0.subdomain =
                  spec.0.termination_grace_period_seconds = 30
                  spec.0.volume.# = 0
=== RUN   TestAccKubernetesPod_with_container_security_context
--- FAIL: TestAccKubernetesPod_with_container_security_context (3.79s)
        testing.go:518: Step 0 error: After applying this step, the plan was not empty:

                DIFF:

                UPDATE: kubernetes_pod.test
                  metadata.0.annotations.%:                           "1" => "0"
                  metadata.0.annotations.cni.projectcalico.org/podIP: "10.156.1.59/32" => ""

                STATE:

                kubernetes_pod.test:
                  ID = default/tf-acc-test-sa6zcw2dzb
                  provider = provider.kubernetes
                  metadata.# = 1
                  metadata.0.annotations.% = 1
                  metadata.0.annotations.cni.projectcalico.org/podIP = 10.156.1.59/32
                  metadata.0.generate_name =
                  metadata.0.generation = 0
                  metadata.0.labels.% = 1
                  metadata.0.labels.app = pod_label
                  metadata.0.name = tf-acc-test-sa6zcw2dzb
                  metadata.0.namespace = default
                  metadata.0.resource_version = 184611
                  metadata.0.self_link = /api/v1/namespaces/default/pods/tf-acc-test-sa6zcw2dzb
                  metadata.0.uid = 945f45c2-f4c3-11e8-b7c4-42010a8e0010
                  spec.# = 1
                  spec.0.active_deadline_seconds = 0
                  spec.0.container.# = 1
                  spec.0.container.0.args.# = 0
                  spec.0.container.0.command.# = 0
                  spec.0.container.0.env.# = 0
                  spec.0.container.0.env_from.# = 0
                  spec.0.container.0.image = nginx:1.7.9
                  spec.0.container.0.image_pull_policy = IfNotPresent
                  spec.0.container.0.lifecycle.# = 0
                  spec.0.container.0.liveness_probe.# = 0
                  spec.0.container.0.name = containername
                  spec.0.container.0.port.# = 0
                  spec.0.container.0.readiness_probe.# = 0
                  spec.0.container.0.resources.# = 1
                  spec.0.container.0.resources.0.limits.# = 0
                  spec.0.container.0.resources.0.requests.# = 1
                  spec.0.container.0.resources.0.requests.0.cpu = 100m
                  spec.0.container.0.resources.0.requests.0.memory =
                  spec.0.container.0.security_context.# = 1
                  spec.0.container.0.security_context.0.capabilities.# = 1
                  spec.0.container.0.security_context.0.capabilities.0.add.# = 2
                  spec.0.container.0.security_context.0.capabilities.0.add.0 = NET_ADMIN
                  spec.0.container.0.security_context.0.capabilities.0.add.1 = SYS_TIME
                  spec.0.container.0.security_context.0.capabilities.0.drop.# = 0
                  spec.0.container.0.security_context.0.privileged = true
                  spec.0.container.0.security_context.0.read_only_root_filesystem = false
                  spec.0.container.0.security_context.0.run_as_non_root = false
                  spec.0.container.0.security_context.0.run_as_user = 1
                  spec.0.container.0.security_context.0.se_linux_options.# = 1
                  spec.0.container.0.security_context.0.se_linux_options.0.level = s0:c123,c456
                  spec.0.container.0.security_context.0.se_linux_options.0.role =
                  spec.0.container.0.security_context.0.se_linux_options.0.type =
                  spec.0.container.0.security_context.0.se_linux_options.0.user =
                  spec.0.container.0.stdin = false
                  spec.0.container.0.stdin_once = false
                  spec.0.container.0.termination_message_path = /dev/termination-log
                  spec.0.container.0.tty = false
                  spec.0.container.0.volume_mount.# = 0
                  spec.0.container.0.working_dir =
                  spec.0.dns_policy = ClusterFirst
                  spec.0.host_ipc = false
                  spec.0.host_network = false
                  spec.0.host_pid = false
                  spec.0.hostname =
                  spec.0.image_pull_secrets.# = 0
                  spec.0.init_container.# = 0
                  spec.0.node_name = gke-pdecat-terraform-kub-default-pool-81f2e275-9jq1
                  spec.0.node_selector.% = 0
                  spec.0.restart_policy = Always
                  spec.0.security_context.# = 0
                  spec.0.service_account_name = default
                  spec.0.subdomain =
                  spec.0.termination_grace_period_seconds = 30
                  spec.0.volume.# = 0
=== RUN   TestAccKubernetesPod_with_volume_mount
--- FAIL: TestAccKubernetesPod_with_volume_mount (7.62s)
        testing.go:518: Step 0 error: After applying this step, the plan was not empty:

                DIFF:

                UPDATE: kubernetes_pod.test
                  metadata.0.annotations.%:                           "1" => "0"
                  metadata.0.annotations.cni.projectcalico.org/podIP: "10.156.2.72/32" => ""

                STATE:

                kubernetes_pod.test:
                  ID = default/tf-acc-test-bclsggdulh
                  provider = provider.kubernetes
                  metadata.# = 1
                  metadata.0.annotations.% = 1
                  metadata.0.annotations.cni.projectcalico.org/podIP = 10.156.2.72/32
                  metadata.0.generate_name =
                  metadata.0.generation = 0
                  metadata.0.labels.% = 1
                  metadata.0.labels.app = pod_label
                  metadata.0.name = tf-acc-test-bclsggdulh
                  metadata.0.namespace = default
                  metadata.0.resource_version = 184638
                  metadata.0.self_link = /api/v1/namespaces/default/pods/tf-acc-test-bclsggdulh
                  metadata.0.uid = 96d163ff-f4c3-11e8-b7c4-42010a8e0010
                  spec.# = 1
                  spec.0.active_deadline_seconds = 0
                  spec.0.container.# = 1
                  spec.0.container.0.args.# = 0
                  spec.0.container.0.command.# = 0
                  spec.0.container.0.env.# = 0
                  spec.0.container.0.env_from.# = 0
                  spec.0.container.0.image = nginx:1.7.9
                  spec.0.container.0.image_pull_policy = IfNotPresent
                  spec.0.container.0.lifecycle.# = 0
                  spec.0.container.0.liveness_probe.# = 0
                  spec.0.container.0.name = containername
                  spec.0.container.0.port.# = 0
                  spec.0.container.0.readiness_probe.# = 0
                  spec.0.container.0.resources.# = 1
                  spec.0.container.0.resources.0.limits.# = 0
                  spec.0.container.0.resources.0.requests.# = 1
                  spec.0.container.0.resources.0.requests.0.cpu = 100m
                  spec.0.container.0.resources.0.requests.0.memory =
                  spec.0.container.0.security_context.# = 0
                  spec.0.container.0.stdin = false
                  spec.0.container.0.stdin_once = false
                  spec.0.container.0.termination_message_path = /dev/termination-log
                  spec.0.container.0.tty = false
                  spec.0.container.0.volume_mount.# = 1
                  spec.0.container.0.volume_mount.0.mount_path = /tmp/my_path
                  spec.0.container.0.volume_mount.0.name = db
                  spec.0.container.0.volume_mount.0.read_only = false
                  spec.0.container.0.volume_mount.0.sub_path =
                  spec.0.container.0.working_dir =
                  spec.0.dns_policy = ClusterFirst
                  spec.0.host_ipc = false
                  spec.0.host_network = false
                  spec.0.host_pid = false
                  spec.0.hostname =
                  spec.0.image_pull_secrets.# = 0
                  spec.0.init_container.# = 0
                  spec.0.node_name = gke-pdecat-terraform-kub-default-pool-42c34e65-7s78
                  spec.0.node_selector.% = 0
                  spec.0.restart_policy = Always
                  spec.0.security_context.# = 0
                  spec.0.service_account_name = default
                  spec.0.subdomain =
                  spec.0.termination_grace_period_seconds = 30
                  spec.0.volume.# = 1
                  spec.0.volume.0.aws_elastic_block_store.# = 0
                  spec.0.volume.0.azure_disk.# = 0
                  spec.0.volume.0.azure_file.# = 0
                  spec.0.volume.0.ceph_fs.# = 0
                  spec.0.volume.0.cinder.# = 0
                  spec.0.volume.0.config_map.# = 0
                  spec.0.volume.0.downward_api.# = 0
                  spec.0.volume.0.empty_dir.# = 0
                  spec.0.volume.0.fc.# = 0
                  spec.0.volume.0.flex_volume.# = 0
                  spec.0.volume.0.flocker.# = 0
                  spec.0.volume.0.gce_persistent_disk.# = 0
                  spec.0.volume.0.git_repo.# = 0
                  spec.0.volume.0.glusterfs.# = 0
                  spec.0.volume.0.host_path.# = 0
                  spec.0.volume.0.iscsi.# = 0
                  spec.0.volume.0.name = db
                  spec.0.volume.0.nfs.# = 0
                  spec.0.volume.0.persistent_volume_claim.# = 0
                  spec.0.volume.0.photon_persistent_disk.# = 0
                  spec.0.volume.0.quobyte.# = 0
                  spec.0.volume.0.rbd.# = 0
                  spec.0.volume.0.secret.# = 1
                  spec.0.volume.0.secret.0.default_mode = 420
                  spec.0.volume.0.secret.0.items.# = 0
                  spec.0.volume.0.secret.0.optional = false
                  spec.0.volume.0.secret.0.secret_name = tf-acc-test-c1c1r9wwea
                  spec.0.volume.0.vsphere_volume.# = 0

                  Dependencies:
                    kubernetes_secret.test
                kubernetes_secret.test:
                  ID = default/tf-acc-test-c1c1r9wwea
                  provider = provider.kubernetes
                  data.% = 1
                  data.one = first
                  metadata.# = 1
                  metadata.0.annotations.% = 0
                  metadata.0.generate_name =
                  metadata.0.generation = 0
                  metadata.0.labels.% = 0
                  metadata.0.name = tf-acc-test-c1c1r9wwea
                  metadata.0.namespace = default
                  metadata.0.resource_version = 184627
                  metadata.0.self_link = /api/v1/namespaces/default/secrets/tf-acc-test-c1c1r9wwea
                  metadata.0.uid = 96a546ee-f4c3-11e8-b7c4-42010a8e0010
                  type = Opaque
=== RUN   TestAccKubernetesPod_with_cfg_map_volume_mount
--- FAIL: TestAccKubernetesPod_with_cfg_map_volume_mount (6.67s)
        testing.go:518: Step 0 error: After applying this step, the plan was not empty:

                DIFF:

                UPDATE: kubernetes_pod.test
                  metadata.0.annotations.%:                           "1" => "0"
                  metadata.0.annotations.cni.projectcalico.org/podIP: "10.156.0.162/32" => ""

                STATE:

                kubernetes_config_map.test:
                  ID = default/tf-acc-test-8x1ghzlqes
                  provider = provider.kubernetes
                  data.% = 1
                  data.one = first
                  metadata.# = 1
                  metadata.0.annotations.% = 0
                  metadata.0.generate_name =
                  metadata.0.generation = 0
                  metadata.0.labels.% = 0
                  metadata.0.name = tf-acc-test-8x1ghzlqes
                  metadata.0.namespace = default
                  metadata.0.resource_version = 184664
                  metadata.0.self_link = /api/v1/namespaces/default/configmaps/tf-acc-test-8x1ghzlqes
                  metadata.0.uid = 9b33b569-f4c3-11e8-b7c4-42010a8e0010
                kubernetes_pod.test:
                  ID = default/tf-acc-test-r0r1yehni2
                  provider = provider.kubernetes
                  metadata.# = 1
                  metadata.0.annotations.% = 1
                  metadata.0.annotations.cni.projectcalico.org/podIP = 10.156.0.162/32
                  metadata.0.generate_name =
                  metadata.0.generation = 0
                  metadata.0.labels.% = 1
                  metadata.0.labels.app = pod_label
                  metadata.0.name = tf-acc-test-r0r1yehni2
                  metadata.0.namespace = default
                  metadata.0.resource_version = 184672
                  metadata.0.self_link = /api/v1/namespaces/default/pods/tf-acc-test-r0r1yehni2
                  metadata.0.uid = 9b5dc2a7-f4c3-11e8-b7c4-42010a8e0010
                  spec.# = 1
                  spec.0.active_deadline_seconds = 0
                  spec.0.container.# = 1
                  spec.0.container.0.args.# = 0
                  spec.0.container.0.command.# = 0
                  spec.0.container.0.env.# = 0
                  spec.0.container.0.env_from.# = 0
                  spec.0.container.0.image = nginx:1.7.9
                  spec.0.container.0.image_pull_policy = IfNotPresent
                  spec.0.container.0.lifecycle.# = 0
                  spec.0.container.0.liveness_probe.# = 0
                  spec.0.container.0.name = containername
                  spec.0.container.0.port.# = 0
                  spec.0.container.0.readiness_probe.# = 0
                  spec.0.container.0.resources.# = 1
                  spec.0.container.0.resources.0.limits.# = 0
                  spec.0.container.0.resources.0.requests.# = 1
                  spec.0.container.0.resources.0.requests.0.cpu = 100m
                  spec.0.container.0.resources.0.requests.0.memory =
                  spec.0.container.0.security_context.# = 0
                  spec.0.container.0.stdin = false
                  spec.0.container.0.stdin_once = false
                  spec.0.container.0.termination_message_path = /dev/termination-log
                  spec.0.container.0.tty = false
                  spec.0.container.0.volume_mount.# = 1
                  spec.0.container.0.volume_mount.0.mount_path = /tmp/my_path
                  spec.0.container.0.volume_mount.0.name = cfg
                  spec.0.container.0.volume_mount.0.read_only = false
                  spec.0.container.0.volume_mount.0.sub_path =
                  spec.0.container.0.working_dir =
                  spec.0.dns_policy = ClusterFirst
                  spec.0.host_ipc = false
                  spec.0.host_network = false
                  spec.0.host_pid = false
                  spec.0.hostname =
                  spec.0.image_pull_secrets.# = 0
                  spec.0.init_container.# = 0
                  spec.0.node_name = gke-pdecat-terraform-kub-default-pool-318bb3a5-18dn
                  spec.0.node_selector.% = 0
                  spec.0.restart_policy = Always
                  spec.0.security_context.# = 0
                  spec.0.service_account_name = default
                  spec.0.subdomain =
                  spec.0.termination_grace_period_seconds = 30
                  spec.0.volume.# = 3
                  spec.0.volume.0.aws_elastic_block_store.# = 0
                  spec.0.volume.0.azure_disk.# = 0
                  spec.0.volume.0.azure_file.# = 0
                  spec.0.volume.0.ceph_fs.# = 0
                  spec.0.volume.0.cinder.# = 0
                  spec.0.volume.0.config_map.# = 1
                  spec.0.volume.0.config_map.0.default_mode = 511
                  spec.0.volume.0.config_map.0.items.# = 0
                  spec.0.volume.0.config_map.0.name = tf-acc-test-8x1ghzlqes
                  spec.0.volume.0.downward_api.# = 0
                  spec.0.volume.0.empty_dir.# = 0
                  spec.0.volume.0.fc.# = 0
                  spec.0.volume.0.flex_volume.# = 0
                  spec.0.volume.0.flocker.# = 0
                  spec.0.volume.0.gce_persistent_disk.# = 0
                  spec.0.volume.0.git_repo.# = 0
                  spec.0.volume.0.glusterfs.# = 0
                  spec.0.volume.0.host_path.# = 0
                  spec.0.volume.0.iscsi.# = 0
                  spec.0.volume.0.name = cfg
                  spec.0.volume.0.nfs.# = 0
                  spec.0.volume.0.persistent_volume_claim.# = 0
                  spec.0.volume.0.photon_persistent_disk.# = 0
                  spec.0.volume.0.quobyte.# = 0
                  spec.0.volume.0.rbd.# = 0
                  spec.0.volume.0.secret.# = 0
                  spec.0.volume.0.vsphere_volume.# = 0
                  spec.0.volume.1.aws_elastic_block_store.# = 0
                  spec.0.volume.1.azure_disk.# = 0
                  spec.0.volume.1.azure_file.# = 0
                  spec.0.volume.1.ceph_fs.# = 0
                  spec.0.volume.1.cinder.# = 0
                  spec.0.volume.1.config_map.# = 1
                  spec.0.volume.1.config_map.0.default_mode = 0
                  spec.0.volume.1.config_map.0.items.# = 1
                  spec.0.volume.1.config_map.0.items.0.key = one
                  spec.0.volume.1.config_map.0.items.0.mode = 0
                  spec.0.volume.1.config_map.0.items.0.path = one.txt
                  spec.0.volume.1.config_map.0.name = tf-acc-test-8x1ghzlqes
                  spec.0.volume.1.downward_api.# = 0
                  spec.0.volume.1.empty_dir.# = 0
                  spec.0.volume.1.fc.# = 0
                  spec.0.volume.1.flex_volume.# = 0
                  spec.0.volume.1.flocker.# = 0
                  spec.0.volume.1.gce_persistent_disk.# = 0
                  spec.0.volume.1.git_repo.# = 0
                  spec.0.volume.1.glusterfs.# = 0
                  spec.0.volume.1.host_path.# = 0
                  spec.0.volume.1.iscsi.# = 0
                  spec.0.volume.1.name = cfg-item
                  spec.0.volume.1.nfs.# = 0
                  spec.0.volume.1.persistent_volume_claim.# = 0
                  spec.0.volume.1.photon_persistent_disk.# = 0
                  spec.0.volume.1.quobyte.# = 0
                  spec.0.volume.1.rbd.# = 0
                  spec.0.volume.1.secret.# = 0
                  spec.0.volume.1.vsphere_volume.# = 0
                  spec.0.volume.2.aws_elastic_block_store.# = 0
                  spec.0.volume.2.azure_disk.# = 0
                  spec.0.volume.2.azure_file.# = 0
                  spec.0.volume.2.ceph_fs.# = 0
                  spec.0.volume.2.cinder.# = 0
                  spec.0.volume.2.config_map.# = 1
                  spec.0.volume.2.config_map.0.default_mode = 0
                  spec.0.volume.2.config_map.0.items.# = 1
                  spec.0.volume.2.config_map.0.items.0.key = one
                  spec.0.volume.2.config_map.0.items.0.mode = 292
                  spec.0.volume.2.config_map.0.items.0.path = one-with-mode.txt
                  spec.0.volume.2.config_map.0.name = tf-acc-test-8x1ghzlqes
                  spec.0.volume.2.downward_api.# = 0
                  spec.0.volume.2.empty_dir.# = 0
                  spec.0.volume.2.fc.# = 0
                  spec.0.volume.2.flex_volume.# = 0
                  spec.0.volume.2.flocker.# = 0
                  spec.0.volume.2.gce_persistent_disk.# = 0
                  spec.0.volume.2.git_repo.# = 0
                  spec.0.volume.2.glusterfs.# = 0
                  spec.0.volume.2.host_path.# = 0
                  spec.0.volume.2.iscsi.# = 0
                  spec.0.volume.2.name = cfg-item-with-mode
                  spec.0.volume.2.nfs.# = 0
                  spec.0.volume.2.persistent_volume_claim.# = 0
                  spec.0.volume.2.photon_persistent_disk.# = 0
                  spec.0.volume.2.quobyte.# = 0
                  spec.0.volume.2.rbd.# = 0
                  spec.0.volume.2.secret.# = 0
                  spec.0.volume.2.vsphere_volume.# = 0

                  Dependencies:
                    kubernetes_config_map.test
=== RUN   TestAccKubernetesPod_with_resource_requirements
--- FAIL: TestAccKubernetesPod_with_resource_requirements (18.18s)
        testing.go:518: Step 0 error: After applying this step, the plan was not empty:

                DIFF:

                UPDATE: kubernetes_pod.test
                  metadata.0.annotations.%:                           "1" => "0"
                  metadata.0.annotations.cni.projectcalico.org/podIP: "10.156.1.60/32" => ""

                STATE:

                kubernetes_pod.test:
                  ID = default/tf-acc-test-u8m7g0zoz0
                  provider = provider.kubernetes
                  metadata.# = 1
                  metadata.0.annotations.% = 1
                  metadata.0.annotations.cni.projectcalico.org/podIP = 10.156.1.60/32
                  metadata.0.generate_name =
                  metadata.0.generation = 0
                  metadata.0.labels.% = 1
                  metadata.0.labels.app = pod_label
                  metadata.0.name = tf-acc-test-u8m7g0zoz0
                  metadata.0.namespace = default
                  metadata.0.resource_version = 184702
                  metadata.0.self_link = /api/v1/namespaces/default/pods/tf-acc-test-u8m7g0zoz0
                  metadata.0.uid = 9f267b8b-f4c3-11e8-b7c4-42010a8e0010
                  spec.# = 1
                  spec.0.active_deadline_seconds = 0
                  spec.0.container.# = 1
                  spec.0.container.0.args.# = 0
                  spec.0.container.0.command.# = 0
                  spec.0.container.0.env.# = 0
                  spec.0.container.0.env_from.# = 0
                  spec.0.container.0.image = nginx:1.7.9
                  spec.0.container.0.image_pull_policy = IfNotPresent
                  spec.0.container.0.lifecycle.# = 0
                  spec.0.container.0.liveness_probe.# = 0
                  spec.0.container.0.name = containername
                  spec.0.container.0.port.# = 0
                  spec.0.container.0.readiness_probe.# = 0
                  spec.0.container.0.resources.# = 1
                  spec.0.container.0.resources.0.limits.# = 1
                  spec.0.container.0.resources.0.limits.0.cpu = 500m
                  spec.0.container.0.resources.0.limits.0.memory = 512Mi
                  spec.0.container.0.resources.0.requests.# = 1
                  spec.0.container.0.resources.0.requests.0.cpu = 250m
                  spec.0.container.0.resources.0.requests.0.memory = 50Mi
                  spec.0.container.0.security_context.# = 0
                  spec.0.container.0.stdin = false
                  spec.0.container.0.stdin_once = false
                  spec.0.container.0.termination_message_path = /dev/termination-log
                  spec.0.container.0.tty = false
                  spec.0.container.0.volume_mount.# = 0
                  spec.0.container.0.working_dir =
                  spec.0.dns_policy = ClusterFirst
                  spec.0.host_ipc = false
                  spec.0.host_network = false
                  spec.0.host_pid = false
                  spec.0.hostname =
                  spec.0.image_pull_secrets.# = 0
                  spec.0.init_container.# = 0
                  spec.0.node_name = gke-pdecat-terraform-kub-default-pool-81f2e275-9jq1
                  spec.0.node_selector.% = 0
                  spec.0.restart_policy = Always
                  spec.0.security_context.# = 0
                  spec.0.service_account_name = default
                  spec.0.subdomain =
                  spec.0.termination_grace_period_seconds = 30
                  spec.0.volume.# = 0
=== RUN   TestAccKubernetesPod_with_empty_dir_volume
--- FAIL: TestAccKubernetesPod_with_empty_dir_volume (10.15s)
        testing.go:518: Step 0 error: After applying this step, the plan was not empty:

                DIFF:

                UPDATE: kubernetes_pod.test
                  metadata.0.annotations.%:                           "1" => "0"
                  metadata.0.annotations.cni.projectcalico.org/podIP: "10.156.2.73/32" => ""

                STATE:

                kubernetes_pod.test:
                  ID = default/tf-acc-test-l6t9tw4e0b
                  provider = provider.kubernetes
                  metadata.# = 1
                  metadata.0.annotations.% = 1
                  metadata.0.annotations.cni.projectcalico.org/podIP = 10.156.2.73/32
                  metadata.0.generate_name =
                  metadata.0.generation = 0
                  metadata.0.labels.% = 1
                  metadata.0.labels.app = pod_label
                  metadata.0.name = tf-acc-test-l6t9tw4e0b
                  metadata.0.namespace = default
                  metadata.0.resource_version = 184768
                  metadata.0.self_link = /api/v1/namespaces/default/pods/tf-acc-test-l6t9tw4e0b
                  metadata.0.uid = a9fc839d-f4c3-11e8-b7c4-42010a8e0010
                  spec.# = 1
                  spec.0.active_deadline_seconds = 0
                  spec.0.container.# = 1
                  spec.0.container.0.args.# = 0
                  spec.0.container.0.command.# = 0
                  spec.0.container.0.env.# = 0
                  spec.0.container.0.env_from.# = 0
                  spec.0.container.0.image = nginx:1.7.9
                  spec.0.container.0.image_pull_policy = IfNotPresent
                  spec.0.container.0.lifecycle.# = 0
                  spec.0.container.0.liveness_probe.# = 0
                  spec.0.container.0.name = containername
                  spec.0.container.0.port.# = 0
                  spec.0.container.0.readiness_probe.# = 0
                  spec.0.container.0.resources.# = 1
                  spec.0.container.0.resources.0.limits.# = 0
                  spec.0.container.0.resources.0.requests.# = 1
                  spec.0.container.0.resources.0.requests.0.cpu = 100m
                  spec.0.container.0.resources.0.requests.0.memory =
                  spec.0.container.0.security_context.# = 0
                  spec.0.container.0.stdin = false
                  spec.0.container.0.stdin_once = false
                  spec.0.container.0.termination_message_path = /dev/termination-log
                  spec.0.container.0.tty = false
                  spec.0.container.0.volume_mount.# = 1
                  spec.0.container.0.volume_mount.0.mount_path = /cache
                  spec.0.container.0.volume_mount.0.name = cache-volume
                  spec.0.container.0.volume_mount.0.read_only = false
                  spec.0.container.0.volume_mount.0.sub_path =
                  spec.0.container.0.working_dir =
                  spec.0.dns_policy = ClusterFirst
                  spec.0.host_ipc = false
                  spec.0.host_network = false
                  spec.0.host_pid = false
                  spec.0.hostname =
                  spec.0.image_pull_secrets.# = 0
                  spec.0.init_container.# = 0
                  spec.0.node_name = gke-pdecat-terraform-kub-default-pool-42c34e65-7s78
                  spec.0.node_selector.% = 0
                  spec.0.restart_policy = Always
                  spec.0.security_context.# = 0
                  spec.0.service_account_name = default
                  spec.0.subdomain =
                  spec.0.termination_grace_period_seconds = 30
                  spec.0.volume.# = 1
                  spec.0.volume.0.aws_elastic_block_store.# = 0
                  spec.0.volume.0.azure_disk.# = 0
                  spec.0.volume.0.azure_file.# = 0
                  spec.0.volume.0.ceph_fs.# = 0
                  spec.0.volume.0.cinder.# = 0
                  spec.0.volume.0.config_map.# = 0
                  spec.0.volume.0.downward_api.# = 0
                  spec.0.volume.0.empty_dir.# = 1
                  spec.0.volume.0.empty_dir.0.medium = Memory
                  spec.0.volume.0.fc.# = 0
                  spec.0.volume.0.flex_volume.# = 0
                  spec.0.volume.0.flocker.# = 0
                  spec.0.volume.0.gce_persistent_disk.# = 0
                  spec.0.volume.0.git_repo.# = 0
                  spec.0.volume.0.glusterfs.# = 0
                  spec.0.volume.0.host_path.# = 0
                  spec.0.volume.0.iscsi.# = 0
                  spec.0.volume.0.name = cache-volume
                  spec.0.volume.0.nfs.# = 0
                  spec.0.volume.0.persistent_volume_claim.# = 0
                  spec.0.volume.0.photon_persistent_disk.# = 0
                  spec.0.volume.0.quobyte.# = 0
                  spec.0.volume.0.rbd.# = 0
                  spec.0.volume.0.secret.# = 0
                  spec.0.volume.0.vsphere_volume.# = 0
=== RUN   TestAccKubernetesPod_with_secret_vol_items
--- FAIL: TestAccKubernetesPod_with_secret_vol_items (11.85s)
        testing.go:518: Step 0 error: After applying this step, the plan was not empty:

                DIFF:

                UPDATE: kubernetes_pod.test
                  metadata.0.annotations.%:                           "1" => "0"
                  metadata.0.annotations.cni.projectcalico.org/podIP: "10.156.0.163/32" => ""

                STATE:

                kubernetes_pod.test:
                  ID = default/tf-acc-test-2dsysjo1er
                  provider = provider.kubernetes
                  metadata.# = 1
                  metadata.0.annotations.% = 1
                  metadata.0.annotations.cni.projectcalico.org/podIP = 10.156.0.163/32
                  metadata.0.generate_name =
                  metadata.0.generation = 0
                  metadata.0.labels.% = 1
                  metadata.0.labels.app = pod_label
                  metadata.0.name = tf-acc-test-2dsysjo1er
                  metadata.0.namespace = default
                  metadata.0.resource_version = 184812
                  metadata.0.self_link = /api/v1/namespaces/default/pods/tf-acc-test-2dsysjo1er
                  metadata.0.uid = b04015ca-f4c3-11e8-b7c4-42010a8e0010
                  spec.# = 1
                  spec.0.active_deadline_seconds = 0
                  spec.0.container.# = 1
                  spec.0.container.0.args.# = 0
                  spec.0.container.0.command.# = 0
                  spec.0.container.0.env.# = 0
                  spec.0.container.0.env_from.# = 0
                  spec.0.container.0.image = nginx:1.7.9
                  spec.0.container.0.image_pull_policy = IfNotPresent
                  spec.0.container.0.lifecycle.# = 0
                  spec.0.container.0.liveness_probe.# = 0
                  spec.0.container.0.name = containername
                  spec.0.container.0.port.# = 0
                  spec.0.container.0.readiness_probe.# = 0
                  spec.0.container.0.resources.# = 1
                  spec.0.container.0.resources.0.limits.# = 0
                  spec.0.container.0.resources.0.requests.# = 1
                  spec.0.container.0.resources.0.requests.0.cpu = 100m
                  spec.0.container.0.resources.0.requests.0.memory =
                  spec.0.container.0.security_context.# = 0
                  spec.0.container.0.stdin = false
                  spec.0.container.0.stdin_once = false
                  spec.0.container.0.termination_message_path = /dev/termination-log
                  spec.0.container.0.tty = false
                  spec.0.container.0.volume_mount.# = 1
                  spec.0.container.0.volume_mount.0.mount_path = /tmp/my_path
                  spec.0.container.0.volume_mount.0.name = db
                  spec.0.container.0.volume_mount.0.read_only = false
                  spec.0.container.0.volume_mount.0.sub_path =
                  spec.0.container.0.working_dir =
                  spec.0.dns_policy = ClusterFirst
                  spec.0.host_ipc = false
                  spec.0.host_network = false
                  spec.0.host_pid = false
                  spec.0.hostname =
                  spec.0.image_pull_secrets.# = 0
                  spec.0.init_container.# = 0
                  spec.0.node_name = gke-pdecat-terraform-kub-default-pool-318bb3a5-18dn
                  spec.0.node_selector.% = 0
                  spec.0.restart_policy = Always
                  spec.0.security_context.# = 0
                  spec.0.service_account_name = default
                  spec.0.subdomain =
                  spec.0.termination_grace_period_seconds = 30
                  spec.0.volume.# = 1
                  spec.0.volume.0.aws_elastic_block_store.# = 0
                  spec.0.volume.0.azure_disk.# = 0
                  spec.0.volume.0.azure_file.# = 0
                  spec.0.volume.0.ceph_fs.# = 0
                  spec.0.volume.0.cinder.# = 0
                  spec.0.volume.0.config_map.# = 0
                  spec.0.volume.0.downward_api.# = 0
                  spec.0.volume.0.empty_dir.# = 0
                  spec.0.volume.0.fc.# = 0
                  spec.0.volume.0.flex_volume.# = 0
                  spec.0.volume.0.flocker.# = 0
                  spec.0.volume.0.gce_persistent_disk.# = 0
                  spec.0.volume.0.git_repo.# = 0
                  spec.0.volume.0.glusterfs.# = 0
                  spec.0.volume.0.host_path.# = 0
                  spec.0.volume.0.iscsi.# = 0
                  spec.0.volume.0.name = db
                  spec.0.volume.0.nfs.# = 0
                  spec.0.volume.0.persistent_volume_claim.# = 0
                  spec.0.volume.0.photon_persistent_disk.# = 0
                  spec.0.volume.0.quobyte.# = 0
                  spec.0.volume.0.rbd.# = 0
                  spec.0.volume.0.secret.# = 1
                  spec.0.volume.0.secret.0.default_mode = 420
                  spec.0.volume.0.secret.0.items.# = 1
                  spec.0.volume.0.secret.0.items.0.key = one
                  spec.0.volume.0.secret.0.items.0.mode = 0
                  spec.0.volume.0.secret.0.items.0.path = path/to/one
                  spec.0.volume.0.secret.0.optional = false
                  spec.0.volume.0.secret.0.secret_name = tf-acc-test-6kdhs9ex4o
                  spec.0.volume.0.vsphere_volume.# = 0

                  Dependencies:
                    kubernetes_secret.test
                kubernetes_secret.test:
                  ID = default/tf-acc-test-6kdhs9ex4o
                  provider = provider.kubernetes
                  data.% = 1
                  data.one = first
                  metadata.# = 1
                  metadata.0.annotations.% = 0
                  metadata.0.generate_name =
                  metadata.0.generation = 0
                  metadata.0.labels.% = 0
                  metadata.0.name = tf-acc-test-6kdhs9ex4o
                  metadata.0.namespace = default
                  metadata.0.resource_version = 184802
                  metadata.0.self_link = /api/v1/namespaces/default/secrets/tf-acc-test-6kdhs9ex4o
                  metadata.0.uid = b00cd41a-f4c3-11e8-b7c4-42010a8e0010
                  type = Opaque
=== RUN   TestAccKubernetesPod_gke_with_nodeSelector
--- FAIL: TestAccKubernetesPod_gke_with_nodeSelector (18.23s)
        testing.go:518: Step 0 error: After applying this step, the plan was not empty:

                DIFF:

                UPDATE: kubernetes_pod.test
                  metadata.0.annotations.%:                           "1" => "0"
                  metadata.0.annotations.cni.projectcalico.org/podIP: "10.156.1.61/32" => ""

                STATE:

                kubernetes_pod.test:
                  ID = default/tf-acc-test-v3c1ev2yke
                  provider = provider.kubernetes
                  metadata.# = 1
                  metadata.0.annotations.% = 1
                  metadata.0.annotations.cni.projectcalico.org/podIP = 10.156.1.61/32
                  metadata.0.generate_name =
                  metadata.0.generation = 0
                  metadata.0.labels.% = 0
                  metadata.0.name = tf-acc-test-v3c1ev2yke
                  metadata.0.namespace = default
                  metadata.0.resource_version = 184862
                  metadata.0.self_link = /api/v1/namespaces/default/pods/tf-acc-test-v3c1ev2yke
                  metadata.0.uid = b7336d11-f4c3-11e8-b7c4-42010a8e0010
                  spec.# = 1
                  spec.0.active_deadline_seconds = 0
                  spec.0.container.# = 1
                  spec.0.container.0.args.# = 0
                  spec.0.container.0.command.# = 0
                  spec.0.container.0.env.# = 0
                  spec.0.container.0.env_from.# = 0
                  spec.0.container.0.image = nginx:1.7.9
                  spec.0.container.0.image_pull_policy = IfNotPresent
                  spec.0.container.0.lifecycle.# = 0
                  spec.0.container.0.liveness_probe.# = 0
                  spec.0.container.0.name = containername
                  spec.0.container.0.port.# = 0
                  spec.0.container.0.readiness_probe.# = 0
                  spec.0.container.0.resources.# = 1
                  spec.0.container.0.resources.0.limits.# = 0
                  spec.0.container.0.resources.0.requests.# = 1
                  spec.0.container.0.resources.0.requests.0.cpu = 100m
                  spec.0.container.0.resources.0.requests.0.memory =
                  spec.0.container.0.security_context.# = 0
                  spec.0.container.0.stdin = false
                  spec.0.container.0.stdin_once = false
                  spec.0.container.0.termination_message_path = /dev/termination-log
                  spec.0.container.0.tty = false
                  spec.0.container.0.volume_mount.# = 0
                  spec.0.container.0.working_dir =
                  spec.0.dns_policy = ClusterFirst
                  spec.0.host_ipc = false
                  spec.0.host_network = false
                  spec.0.host_pid = false
                  spec.0.hostname =
                  spec.0.image_pull_secrets.# = 0
                  spec.0.init_container.# = 0
                  spec.0.node_name = gke-pdecat-terraform-kub-default-pool-81f2e275-9jq1
                  spec.0.node_selector.% = 1
                  spec.0.node_selector.failure-domain.beta.kubernetes.io/region = us-east1
                  spec.0.restart_policy = Always
                  spec.0.security_context.# = 0
                  spec.0.service_account_name = default
                  spec.0.subdomain =
                  spec.0.termination_grace_period_seconds = 30
                  spec.0.volume.# = 0
=== RUN   TestAccKubernetesReplicationController_deprecated_basic
--- PASS: TestAccKubernetesReplicationController_deprecated_basic (116.29s)
=== RUN   TestAccKubernetesReplicationController_deprecated_initContainer
--- PASS: TestAccKubernetesReplicationController_deprecated_initContainer (115.87s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importBasic
--- PASS: TestAccKubernetesReplicationController_deprecated_importBasic (115.24s)
=== RUN   TestAccKubernetesReplicationController_deprecated_generatedName
--- PASS: TestAccKubernetesReplicationController_deprecated_generatedName (2.24s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_deprecated_importGeneratedName (1.79s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_security_context (1.62s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec (1.63s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get (1.62s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp (2.07s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_lifecycle (1.76s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_security_context (1.78s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_deprecated_with_volume_mount (2.53s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_deprecated_with_resource_requirements (2.35s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume (1.63s)
=== RUN   TestAccKubernetesReplicationController_basic
--- PASS: TestAccKubernetesReplicationController_basic (115.93s)
=== RUN   TestAccKubernetesReplicationController_initContainer
--- PASS: TestAccKubernetesReplicationController_initContainer (115.07s)
=== RUN   TestAccKubernetesReplicationController_importBasic
--- PASS: TestAccKubernetesReplicationController_importBasic (114.99s)
=== RUN   TestAccKubernetesReplicationController_generatedName
--- PASS: TestAccKubernetesReplicationController_generatedName (1.61s)
=== RUN   TestAccKubernetesReplicationController_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_importGeneratedName (1.71s)
=== RUN   TestAccKubernetesReplicationController_with_security_context
--- PASS: TestAccKubernetesReplicationController_with_security_context (1.75s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec (2.38s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get (1.65s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp (1.66s)
=== RUN   TestAccKubernetesReplicationController_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_with_container_lifecycle (1.62s)
=== RUN   TestAccKubernetesReplicationController_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_with_container_security_context (2.10s)
=== RUN   TestAccKubernetesReplicationController_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_with_volume_mount (2.54s)
=== RUN   TestAccKubernetesReplicationController_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_with_resource_requirements (1.62s)
=== RUN   TestAccKubernetesReplicationController_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_with_empty_dir_volume (1.59s)
=== RUN   TestAccKubernetesResourceQuota_basic
--- PASS: TestAccKubernetesResourceQuota_basic (3.56s)
=== RUN   TestAccKubernetesResourceQuota_generatedName
--- PASS: TestAccKubernetesResourceQuota_generatedName (1.86s)
=== RUN   TestAccKubernetesResourceQuota_withScopes
--- PASS: TestAccKubernetesResourceQuota_withScopes (2.42s)
=== RUN   TestAccKubernetesResourceQuota_importBasic
--- PASS: TestAccKubernetesResourceQuota_importBasic (1.43s)
=== RUN   TestAccKubernetesSecret_basic
--- PASS: TestAccKubernetesSecret_basic (4.90s)
=== RUN   TestAccKubernetesSecret_importBasic
--- PASS: TestAccKubernetesSecret_importBasic (1.31s)
=== RUN   TestAccKubernetesSecret_generatedName
--- PASS: TestAccKubernetesSecret_generatedName (1.29s)
=== RUN   TestAccKubernetesSecret_importGeneratedName
--- PASS: TestAccKubernetesSecret_importGeneratedName (1.40s)
=== RUN   TestAccKubernetesSecret_binaryData
--- PASS: TestAccKubernetesSecret_binaryData (2.30s)
=== RUN   TestAccKubernetesServiceAccount_basic
--- PASS: TestAccKubernetesServiceAccount_basic (2.31s)
=== RUN   TestAccKubernetesServiceAccount_automount
--- PASS: TestAccKubernetesServiceAccount_automount (2.31s)
=== RUN   TestAccKubernetesServiceAccount_update
--- PASS: TestAccKubernetesServiceAccount_update (4.21s)
=== RUN   TestAccKubernetesServiceAccount_generatedName
--- PASS: TestAccKubernetesServiceAccount_generatedName (1.30s)
=== RUN   TestAccKubernetesService_basic
--- PASS: TestAccKubernetesService_basic (2.34s)
=== RUN   TestAccKubernetesService_loadBalancer
--- PASS: TestAccKubernetesService_loadBalancer (59.44s)
=== RUN   TestAccKubernetesService_nodePort
--- PASS: TestAccKubernetesService_nodePort (1.79s)
=== RUN   TestAccKubernetesService_noTargetPort
--- PASS: TestAccKubernetesService_noTargetPort (98.88s)
=== RUN   TestAccKubernetesService_stringTargetPort
--- PASS: TestAccKubernetesService_stringTargetPort (109.35s)
=== RUN   TestAccKubernetesService_externalName
--- PASS: TestAccKubernetesService_externalName (1.46s)
=== RUN   TestAccKubernetesService_importBasic
--- PASS: TestAccKubernetesService_importBasic (1.68s)
=== RUN   TestAccKubernetesService_generatedName
--- PASS: TestAccKubernetesService_generatedName (1.35s)
=== RUN   TestAccKubernetesService_importGeneratedName
--- PASS: TestAccKubernetesService_importGeneratedName (1.59s)
=== RUN   TestAccKubernetesStatefulSet_basic
--- PASS: TestAccKubernetesStatefulSet_basic (2.02s)
=== RUN   TestAccKubernetesStatefulSet_basic_idempotency
--- PASS: TestAccKubernetesStatefulSet_basic_idempotency (2.27s)
=== RUN   TestAccKubernetesStatefulSet_update_template_selector_labels
--- PASS: TestAccKubernetesStatefulSet_update_template_selector_labels (3.08s)
=== RUN   TestAccKubernetesStatefulSet_update_replicas
--- PASS: TestAccKubernetesStatefulSet_update_replicas (2.73s)
=== RUN   TestAccKubernetesStatefulSet_update_rolling_update_partition
--- PASS: TestAccKubernetesStatefulSet_update_rolling_update_partition (2.77s)
=== RUN   TestAccKubernetesStatefulSet_update_update_strategy_on_delete
--- PASS: TestAccKubernetesStatefulSet_update_update_strategy_on_delete (2.74s)
=== RUN   TestAccKubernetesStatefulSet_update_update_strategy_rolling_update
--- PASS: TestAccKubernetesStatefulSet_update_update_strategy_rolling_update (2.68s)
=== RUN   TestAccKubernetesStatefulSet_update_pod_template_container_port
--- PASS: TestAccKubernetesStatefulSet_update_pod_template_container_port (3.02s)
=== RUN   TestAccKubernetesStorageClass_basic
--- PASS: TestAccKubernetesStorageClass_basic (3.91s)
=== RUN   TestAccKubernetesStorageClass_importBasic
--- PASS: TestAccKubernetesStorageClass_importBasic (1.58s)
=== RUN   TestAccKubernetesStorageClass_generatedName
--- PASS: TestAccKubernetesStorageClass_generatedName (1.44s)
=== RUN   TestAccKubernetesStorageClass_importGeneratedName
--- PASS: TestAccKubernetesStorageClass_importGeneratedName (1.50s)
FAIL
FAIL    github.com/terraform-providers/terraform-provider-kubernetes/kubernetes 3804.479s
make: *** [GNUmakefile:17: testacc] Error 1

Those related to annotations fail because this cluster has Calico as the network policy implementation and it adds some, e.g.:

                UPDATE: kubernetes_pod.test
                  metadata.0.annotations.%:                           "1" => "0"
                  metadata.0.annotations.cni.projectcalico.org/podIP: "10.156.1.61/32" => ""

Others time out for some not yet understood reasons...

@alexsomesan
Copy link
Member

@pdecat The deployment ones are known flakes. They fail sometime but not always. Don't worry about them. I'll investigate what's up with them.

@pdecat pdecat force-pushed the fix-replication-controller-metadata branch from 8829aef to 1b2421e Compare November 30, 2018 18:45
… and introduce new tests using the non deprecated fields
…h new ones, mixed use-cases are now prevented
…est case to use testAccKubernetesReplicationControllerConfig_deprecated_generatedName
…d to preserve the Required property of the metadata field
@pdecat pdecat force-pushed the fix-replication-controller-metadata branch from a24673a to 9532a33 Compare January 11, 2019 13:10
@pdecat
Copy link
Contributor Author

pdecat commented Jan 11, 2019

Hi @alexsomesan, I've launched another complete run of acceptance tests and only the unrelated TestAccKubernetesRole_.* ones are failing:

# make testacc TEST=./kubernetes TESTARGS='-run=TestAccKubernetes.* -count=1'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./kubernetes -v -run=TestAccKubernetes.* -count=1 -timeout 120m
=== RUN   TestAccKubernetesDataSourceSecret_basic
--- PASS: TestAccKubernetesDataSourceSecret_basic (2.30s)
=== RUN   TestAccKubernetesDataSourceService_basic
--- PASS: TestAccKubernetesDataSourceService_basic (1.31s)
=== RUN   TestAccKubernetesDataSourceStorageClass_basic
--- PASS: TestAccKubernetesDataSourceStorageClass_basic (1.26s)
=== RUN   TestAccKubernetesClusterRoleBinding
--- PASS: TestAccKubernetesClusterRoleBinding (2.37s)
=== RUN   TestAccKubernetesClusterRoleBinding_importBasic
--- PASS: TestAccKubernetesClusterRoleBinding_importBasic (1.40s)
=== RUN   TestAccKubernetesConfigMap_basic
--- PASS: TestAccKubernetesConfigMap_basic (3.65s)
=== RUN   TestAccKubernetesConfigMap_importBasic
--- PASS: TestAccKubernetesConfigMap_importBasic (1.30s)
=== RUN   TestAccKubernetesConfigMap_generatedName
--- PASS: TestAccKubernetesConfigMap_generatedName (1.25s)
=== RUN   TestAccKubernetesConfigMap_importGeneratedName
--- PASS: TestAccKubernetesConfigMap_importGeneratedName (1.32s)
=== RUN   TestAccKubernetesDeployment_basic
--- PASS: TestAccKubernetesDeployment_basic (68.05s)
=== RUN   TestAccKubernetesDeployment_initContainer
--- PASS: TestAccKubernetesDeployment_initContainer (128.64s)
=== RUN   TestAccKubernetesDeployment_importBasic
--- PASS: TestAccKubernetesDeployment_importBasic (118.92s)
=== RUN   TestAccKubernetesDeployment_generatedName
--- PASS: TestAccKubernetesDeployment_generatedName (28.13s)
=== RUN   TestAccKubernetesDeployment_importGeneratedName
--- PASS: TestAccKubernetesDeployment_importGeneratedName (47.93s)
=== RUN   TestAccKubernetesDeployment_with_security_context
--- PASS: TestAccKubernetesDeployment_with_security_context (9.25s)
=== RUN   TestAccKubernetesDeployment_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesDeployment_with_container_liveness_probe_using_exec (9.22s)
=== RUN   TestAccKubernetesDeployment_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesDeployment_with_container_liveness_probe_using_http_get (17.29s)
=== RUN   TestAccKubernetesDeployment_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesDeployment_with_container_liveness_probe_using_tcp (17.64s)
=== RUN   TestAccKubernetesDeployment_with_container_lifecycle
--- PASS: TestAccKubernetesDeployment_with_container_lifecycle (9.24s)
=== RUN   TestAccKubernetesDeployment_with_container_security_context
--- PASS: TestAccKubernetesDeployment_with_container_security_context (17.40s)
=== RUN   TestAccKubernetesDeployment_with_volume_mount
--- PASS: TestAccKubernetesDeployment_with_volume_mount (10.12s)
=== RUN   TestAccKubernetesDeployment_with_resource_requirements
--- PASS: TestAccKubernetesDeployment_with_resource_requirements (9.25s)
=== RUN   TestAccKubernetesDeployment_with_empty_dir_volume
--- PASS: TestAccKubernetesDeployment_with_empty_dir_volume (17.46s)
=== RUN   TestAccKubernetesDeploymentUpdate_basic
--- PASS: TestAccKubernetesDeploymentUpdate_basic (18.73s)
=== RUN   TestAccKubernetesHorizontalPodAutoscaler_basic
--- PASS: TestAccKubernetesHorizontalPodAutoscaler_basic (3.08s)
=== RUN   TestAccKubernetesHorizontalPodAutoscaler_generatedName
--- PASS: TestAccKubernetesHorizontalPodAutoscaler_generatedName (1.16s)
=== RUN   TestAccKubernetesHorizontalPodAutoscaler_importBasic
--- PASS: TestAccKubernetesHorizontalPodAutoscaler_importBasic (1.23s)
=== RUN   TestAccKubernetesLimitRange_basic
--- PASS: TestAccKubernetesLimitRange_basic (2.90s)
=== RUN   TestAccKubernetesLimitRange_empty
--- PASS: TestAccKubernetesLimitRange_empty (1.35s)
=== RUN   TestAccKubernetesLimitRange_generatedName
--- PASS: TestAccKubernetesLimitRange_generatedName (1.23s)
=== RUN   TestAccKubernetesLimitRange_typeChange
--- PASS: TestAccKubernetesLimitRange_typeChange (2.03s)
=== RUN   TestAccKubernetesLimitRange_multipleLimits
--- PASS: TestAccKubernetesLimitRange_multipleLimits (1.13s)
=== RUN   TestAccKubernetesLimitRange_importBasic
--- PASS: TestAccKubernetesLimitRange_importBasic (1.24s)
=== RUN   TestAccKubernetesNamespace_basic
--- PASS: TestAccKubernetesNamespace_basic (11.36s)
=== RUN   TestAccKubernetesNamespace_invalidLabelValueType
--- PASS: TestAccKubernetesNamespace_invalidLabelValueType (0.04s)
=== RUN   TestAccKubernetesNamespace_importBasic
--- PASS: TestAccKubernetesNamespace_importBasic (9.08s)
=== RUN   TestAccKubernetesNamespace_generatedName
--- PASS: TestAccKubernetesNamespace_generatedName (7.92s)
=== RUN   TestAccKubernetesNamespace_withSpecialCharacters
--- PASS: TestAccKubernetesNamespace_withSpecialCharacters (8.00s)
=== RUN   TestAccKubernetesNamespace_importGeneratedName
--- PASS: TestAccKubernetesNamespace_importGeneratedName (8.42s)
=== RUN   TestAccKubernetesPersistentVolumeClaim_basic
--- PASS: TestAccKubernetesPersistentVolumeClaim_basic (4.00s)
=== RUN   TestAccKubernetesPersistentVolumeClaim_googleCloud_importBasic
--- PASS: TestAccKubernetesPersistentVolumeClaim_googleCloud_importBasic (35.03s)
=== RUN   TestAccKubernetesPersistentVolumeClaim_googleCloud_volumeMatch
--- PASS: TestAccKubernetesPersistentVolumeClaim_googleCloud_volumeMatch (44.34s)
=== RUN   TestAccKubernetesPersistentVolumeClaim_googleCloud_volumeUpdate
--- PASS: TestAccKubernetesPersistentVolumeClaim_googleCloud_volumeUpdate (31.33s)
=== RUN   TestAccKubernetesPersistentVolumeClaim_googleCloud_storageClass
--- PASS: TestAccKubernetesPersistentVolumeClaim_googleCloud_storageClass (10.70s)
=== RUN   TestAccKubernetesPersistentVolume_googleCloud_basic
--- PASS: TestAccKubernetesPersistentVolume_googleCloud_basic (29.74s)
=== RUN   TestAccKubernetesPersistentVolume_aws_basic
--- SKIP: TestAccKubernetesPersistentVolume_aws_basic (0.01s)
    provider_test.go:195: The environment variables AWS_DEFAULT_REGION, AWS_ZONE, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY must be set to run AWS tests - skipping
=== RUN   TestAccKubernetesPersistentVolume_googleCloud_importBasic
--- PASS: TestAccKubernetesPersistentVolume_googleCloud_importBasic (27.03s)
=== RUN   TestAccKubernetesPersistentVolume_googleCloud_volumeSource
--- PASS: TestAccKubernetesPersistentVolume_googleCloud_volumeSource (27.74s)
=== RUN   TestAccKubernetesPersistentVolume_hostPath_volumeSource
--- PASS: TestAccKubernetesPersistentVolume_hostPath_volumeSource (2.95s)
=== RUN   TestAccKubernetesPersistentVolume_local_volumeSource
--- PASS: TestAccKubernetesPersistentVolume_local_volumeSource (3.16s)
=== RUN   TestAccKubernetesPersistentVolume_cephFsSecretRef
--- PASS: TestAccKubernetesPersistentVolume_cephFsSecretRef (1.44s)
=== RUN   TestAccKubernetesPersistentVolume_storageClass
--- PASS: TestAccKubernetesPersistentVolume_storageClass (28.91s)
=== RUN   TestAccKubernetesPersistentVolume_hostPath_nodeAffinity
--- PASS: TestAccKubernetesPersistentVolume_hostPath_nodeAffinity (5.67s)
=== RUN   TestAccKubernetesPod_basic
--- PASS: TestAccKubernetesPod_basic (52.26s)
=== RUN   TestAccKubernetesPod_initContainer_updateForcesNew
--- PASS: TestAccKubernetesPod_initContainer_updateForcesNew (34.00s)
=== RUN   TestAccKubernetesPod_updateArgsForceNew
--- PASS: TestAccKubernetesPod_updateArgsForceNew (81.25s)
=== RUN   TestAccKubernetesPod_updateEnvForceNew
--- PASS: TestAccKubernetesPod_updateEnvForceNew (14.29s)
=== RUN   TestAccKubernetesPod_importBasic
--- PASS: TestAccKubernetesPod_importBasic (7.32s)
=== RUN   TestAccKubernetesPod_with_pod_security_context
--- PASS: TestAccKubernetesPod_with_pod_security_context (11.29s)
=== RUN   TestAccKubernetesPod_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesPod_with_container_liveness_probe_using_exec (38.53s)
=== RUN   TestAccKubernetesPod_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesPod_with_container_liveness_probe_using_http_get (7.35s)
=== RUN   TestAccKubernetesPod_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesPod_with_container_liveness_probe_using_tcp (8.65s)
=== RUN   TestAccKubernetesPod_with_container_lifecycle
--- PASS: TestAccKubernetesPod_with_container_lifecycle (19.21s)
=== RUN   TestAccKubernetesPod_with_container_security_context
--- PASS: TestAccKubernetesPod_with_container_security_context (6.91s)
=== RUN   TestAccKubernetesPod_with_volume_mount
--- PASS: TestAccKubernetesPod_with_volume_mount (9.59s)
=== RUN   TestAccKubernetesPod_with_cfg_map_volume_mount
--- PASS: TestAccKubernetesPod_with_cfg_map_volume_mount (20.91s)
=== RUN   TestAccKubernetesPod_with_resource_requirements
--- PASS: TestAccKubernetesPod_with_resource_requirements (11.94s)
=== RUN   TestAccKubernetesPod_with_empty_dir_volume
--- PASS: TestAccKubernetesPod_with_empty_dir_volume (19.14s)
=== RUN   TestAccKubernetesPod_with_secret_vol_items
--- PASS: TestAccKubernetesPod_with_secret_vol_items (7.79s)
=== RUN   TestAccKubernetesPod_gke_with_nodeSelector
--- PASS: TestAccKubernetesPod_gke_with_nodeSelector (19.68s)
=== RUN   TestAccKubernetesReplicationController_deprecated_basic
--- PASS: TestAccKubernetesReplicationController_deprecated_basic (116.28s)
=== RUN   TestAccKubernetesReplicationController_deprecated_initContainer
--- PASS: TestAccKubernetesReplicationController_deprecated_initContainer (115.04s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importBasic
--- PASS: TestAccKubernetesReplicationController_deprecated_importBasic (114.88s)
=== RUN   TestAccKubernetesReplicationController_deprecated_generatedName
--- PASS: TestAccKubernetesReplicationController_deprecated_generatedName (1.57s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_deprecated_importGeneratedName (2.05s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_security_context (1.44s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec (1.56s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get (1.48s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp (1.48s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_lifecycle (1.55s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_security_context (1.53s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_deprecated_with_volume_mount (2.43s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_deprecated_with_resource_requirements (1.54s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume (1.47s)
=== RUN   TestAccKubernetesReplicationController_basic
--- PASS: TestAccKubernetesReplicationController_basic (115.73s)
=== RUN   TestAccKubernetesReplicationController_initContainer
--- PASS: TestAccKubernetesReplicationController_initContainer (115.07s)
=== RUN   TestAccKubernetesReplicationController_importBasic
--- PASS: TestAccKubernetesReplicationController_importBasic (115.03s)
=== RUN   TestAccKubernetesReplicationController_generatedName
--- PASS: TestAccKubernetesReplicationController_generatedName (1.88s)
=== RUN   TestAccKubernetesReplicationController_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_importGeneratedName (1.69s)
=== RUN   TestAccKubernetesReplicationController_with_security_context
--- PASS: TestAccKubernetesReplicationController_with_security_context (1.47s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec (1.85s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get (1.60s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp (1.52s)
=== RUN   TestAccKubernetesReplicationController_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_with_container_lifecycle (1.62s)
=== RUN   TestAccKubernetesReplicationController_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_with_container_security_context (1.57s)
=== RUN   TestAccKubernetesReplicationController_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_with_volume_mount (2.40s)
=== RUN   TestAccKubernetesReplicationController_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_with_resource_requirements (1.50s)
=== RUN   TestAccKubernetesReplicationController_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_with_empty_dir_volume (1.47s)
=== RUN   TestAccKubernetesResourceQuota_basic
--- PASS: TestAccKubernetesResourceQuota_basic (3.12s)
=== RUN   TestAccKubernetesResourceQuota_generatedName
--- PASS: TestAccKubernetesResourceQuota_generatedName (1.26s)
=== RUN   TestAccKubernetesResourceQuota_withScopes
--- PASS: TestAccKubernetesResourceQuota_withScopes (2.22s)
=== RUN   TestAccKubernetesResourceQuota_importBasic
--- PASS: TestAccKubernetesResourceQuota_importBasic (1.35s)
=== RUN   TestAccKubernetesRole_basic
--- FAIL: TestAccKubernetesRole_basic (0.20s)
    testing.go:538: Step 0 error: Error applying: 1 error occurred:
                * kubernetes_role.test: 1 error occurred:
                * kubernetes_role.test: roles.rbac.authorization.k8s.io "tf-acc-test-n9ajbb8c3w" is forbidden: attempt to grant extra privileges: [{[list] [] [pods] [foo] []} {[watch] []
 [pods] [foo] []} {[get] [] [pods] [foo] []} {[list] [apps] [deployments] [] []} {[get] [apps] [deployments] [] []}] user=&{p*@****  [system:authenticated] map[user-assertion.cloud.google.com:[*****]]} ownerrules=[{[create] [authorization.k8s.io] [selfsubjectaccessreviews selfsubjectrulesreviews] [] []}
 {[get] [] [] [] [/api /api/* /apis /apis/* /healthz /openapi /openapi/* /swagger-2.0.0.pb-v1 /swagger.json /swaggerapi /swaggerapi/* /version /version/]}] ruleResolutionErrors=[]




=== RUN   TestAccKubernetesRole_importBasic
--- FAIL: TestAccKubernetesRole_importBasic (0.14s)
    testing.go:538: Step 0 error: Error applying: 1 error occurred:
                * kubernetes_role.test: 1 error occurred:
                * kubernetes_role.test: roles.rbac.authorization.k8s.io "tf-acc-test-eps7mndm6n" is forbidden: attempt to grant extra privileges: [{[list] [] [pods] [foo] []} {[watch] []
 [pods] [foo] []} {[get] [] [pods] [foo] []} {[list] [apps] [deployments] [] []} {[get] [apps] [deployments] [] []}] user=&{p*@****  [system:authenticated] map[user-assertion.cloud.google.com:[*****]]} ownerrules=[{[create] [authorization.k8s.io] [selfsubjectaccessreviews selfsubjectrulesreviews] [] []}
 {[get] [] [] [] [/api /api/* /apis /apis/* /healthz /openapi /openapi/* /swagger-2.0.0.pb-v1 /swagger.json /swaggerapi /swaggerapi/* /version /version/]}] ruleResolutionErrors=[]




=== RUN   TestAccKubernetesRole_generatedName
--- FAIL: TestAccKubernetesRole_generatedName (0.17s)
    testing.go:538: Step 0 error: Error applying: 1 error occurred:
                * kubernetes_role.test: 1 error occurred:
                * kubernetes_role.test: roles.rbac.authorization.k8s.io is forbidden: attempt to grant extra privileges: [{[watch] [batch] [jobs] [] []}] user=&{p*@****  [system:authenticated] map[user-assertion.cloud.google.com:[*****]]} ownerrules=[{[create] [authorization.k8s.io] [selfsubjectaccessre
views selfsubjectrulesreviews] [] []} {[get] [] [] [] [/api /api/* /apis /apis/* /healthz /openapi /openapi/* /swagger-2.0.0.pb-v1 /swagger.json /swaggerapi /swaggerapi/* /version /versi
on/]}] ruleResolutionErrors=[]




=== RUN   TestAccKubernetesSecret_basic
--- PASS: TestAccKubernetesSecret_basic (4.66s)
=== RUN   TestAccKubernetesSecret_importBasic
--- PASS: TestAccKubernetesSecret_importBasic (1.21s)
=== RUN   TestAccKubernetesSecret_generatedName
--- PASS: TestAccKubernetesSecret_generatedName (1.11s)
=== RUN   TestAccKubernetesSecret_importGeneratedName
--- PASS: TestAccKubernetesSecret_importGeneratedName (1.20s)
=== RUN   TestAccKubernetesSecret_binaryData
--- PASS: TestAccKubernetesSecret_binaryData (2.05s)
=== RUN   TestAccKubernetesServiceAccount_basic
--- PASS: TestAccKubernetesServiceAccount_basic (2.68s)
=== RUN   TestAccKubernetesServiceAccount_automount
--- PASS: TestAccKubernetesServiceAccount_automount (2.53s)
=== RUN   TestAccKubernetesServiceAccount_update
--- PASS: TestAccKubernetesServiceAccount_update (4.10s)
=== RUN   TestAccKubernetesServiceAccount_generatedName
--- PASS: TestAccKubernetesServiceAccount_generatedName (1.24s)
=== RUN   TestAccKubernetesService_basic
--- PASS: TestAccKubernetesService_basic (2.18s)
=== RUN   TestAccKubernetesService_loadBalancer
--- PASS: TestAccKubernetesService_loadBalancer (49.05s)
=== RUN   TestAccKubernetesService_nodePort
--- PASS: TestAccKubernetesService_nodePort (1.25s)
=== RUN   TestAccKubernetesService_noTargetPort
--- PASS: TestAccKubernetesService_noTargetPort (88.36s)
=== RUN   TestAccKubernetesService_stringTargetPort
--- PASS: TestAccKubernetesService_stringTargetPort (98.48s)
=== RUN   TestAccKubernetesService_externalName
--- PASS: TestAccKubernetesService_externalName (1.23s)
=== RUN   TestAccKubernetesService_importBasic
--- PASS: TestAccKubernetesService_importBasic (1.26s)
=== RUN   TestAccKubernetesService_generatedName
--- PASS: TestAccKubernetesService_generatedName (1.17s)
=== RUN   TestAccKubernetesService_importGeneratedName
--- PASS: TestAccKubernetesService_importGeneratedName (1.29s)
=== RUN   TestAccKubernetesStatefulSet_basic
--- PASS: TestAccKubernetesStatefulSet_basic (1.33s)
=== RUN   TestAccKubernetesStatefulSet_basic_idempotency
--- PASS: TestAccKubernetesStatefulSet_basic_idempotency (1.82s)
=== RUN   TestAccKubernetesStatefulSet_update_image
--- PASS: TestAccKubernetesStatefulSet_update_image (2.36s)
=== RUN   TestAccKubernetesStatefulSet_update_template_selector_labels
--- PASS: TestAccKubernetesStatefulSet_update_template_selector_labels (2.56s)
=== RUN   TestAccKubernetesStatefulSet_update_replicas
--- PASS: TestAccKubernetesStatefulSet_update_replicas (2.25s)
=== RUN   TestAccKubernetesStatefulSet_update_rolling_update_partition
--- PASS: TestAccKubernetesStatefulSet_update_rolling_update_partition (2.15s)
=== RUN   TestAccKubernetesStatefulSet_update_update_strategy_on_delete
--- PASS: TestAccKubernetesStatefulSet_update_update_strategy_on_delete (2.36s)
=== RUN   TestAccKubernetesStatefulSet_update_update_strategy_rolling_update
--- PASS: TestAccKubernetesStatefulSet_update_update_strategy_rolling_update (2.28s)
=== RUN   TestAccKubernetesStatefulSet_update_pod_template_container_port
--- PASS: TestAccKubernetesStatefulSet_update_pod_template_container_port (2.81s)
=== RUN   TestAccKubernetesStorageClass_basic
--- PASS: TestAccKubernetesStorageClass_basic (2.94s)
=== RUN   TestAccKubernetesStorageClass_importBasic
--- PASS: TestAccKubernetesStorageClass_importBasic (1.29s)
=== RUN   TestAccKubernetesStorageClass_generatedName
--- PASS: TestAccKubernetesStorageClass_generatedName (1.12s)
=== RUN   TestAccKubernetesStorageClass_importGeneratedName
--- PASS: TestAccKubernetesStorageClass_importGeneratedName (1.20s)
FAIL
FAIL    github.com/terraform-providers/terraform-provider-kubernetes/kubernetes 2254.481s
make: *** [GNUmakefile:17: testacc] Error 1

PS: sorry for the double post, wrong account on first one 🤷‍♂️

@pdecat
Copy link
Contributor Author

pdecat commented Jan 11, 2019

Ok, all acceptance tests now pass after acquiring the proper permissions on my test GKE cluster with kubectl --user=$KUBE_CTX_AUTH_INFO --cluster=$KUBE_CTX_CLUSTER create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user $(gcloud config get-value account).

@alexsomesan
Copy link
Member

@pdecat thanks for making sure all tests pass.
The internal CI is being migrated to Go modules so I can't run tests right now the "official" way. I'm going to merge this on you test results.

BTW, there is a terraform template in the repo that builds a GKE test environments. It's what our CI also uses, so you get an accurate environment. You find it in kubernetes/test-infra/gke. Just set GCloud creds via env vars and run terraform apply in that folder and you get an acc test setup.

Copy link
Member

@alexsomesan alexsomesan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexsomesan alexsomesan merged commit d5ff12c into hashicorp:master Jan 11, 2019
@pdecat
Copy link
Contributor Author

pdecat commented Jan 11, 2019

Thanks again @alexsomesan !

For the record, here are the acceptance test results from master after the merge:

# git status
On branch master
Your branch is up to date with 'upstream/master'.

nothing to commit, working tree clean
# git log -n 1
commit d5ff12c5b137b7a04be60e640d3c7c8b654d659e (HEAD -> master, upstream/master, upstream/HEAD)
Author: Patrick Decat <pdecat@gmail.com>
Date:   Fri Jan 11 16:30:53 2019 +0100

    Add  pod metadata to replication controller spec template (#193)
    
    * Add pod metadata to replication controller spec template
    * Mark affected attributes as deprecated to allow for a migration path
# make testacc TEST=./kubernetes TESTARGS='-run=TestAccKubernetes.* -count=1'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./kubernetes -v -run=TestAccKubernetes.* -count=1 -timeout 120m
=== RUN   TestAccKubernetesDataSourceSecret_basic
--- PASS: TestAccKubernetesDataSourceSecret_basic (1.48s)
=== RUN   TestAccKubernetesDataSourceService_basic
--- PASS: TestAccKubernetesDataSourceService_basic (1.23s)
=== RUN   TestAccKubernetesDataSourceStorageClass_basic
--- PASS: TestAccKubernetesDataSourceStorageClass_basic (1.18s)
=== RUN   TestAccKubernetesClusterRoleBinding
--- PASS: TestAccKubernetesClusterRoleBinding (1.83s)
=== RUN   TestAccKubernetesClusterRoleBinding_importBasic
--- PASS: TestAccKubernetesClusterRoleBinding_importBasic (1.14s)
=== RUN   TestAccKubernetesConfigMap_basic
--- PASS: TestAccKubernetesConfigMap_basic (3.60s)
=== RUN   TestAccKubernetesConfigMap_importBasic
--- PASS: TestAccKubernetesConfigMap_importBasic (1.14s)
=== RUN   TestAccKubernetesConfigMap_generatedName
--- PASS: TestAccKubernetesConfigMap_generatedName (1.17s)
=== RUN   TestAccKubernetesConfigMap_importGeneratedName
--- PASS: TestAccKubernetesConfigMap_importGeneratedName (1.14s)
=== RUN   TestAccKubernetesDeployment_basic
--- PASS: TestAccKubernetesDeployment_basic (78.13s)
=== RUN   TestAccKubernetesDeployment_initContainer
--- PASS: TestAccKubernetesDeployment_initContainer (119.28s)
=== RUN   TestAccKubernetesDeployment_importBasic
--- PASS: TestAccKubernetesDeployment_importBasic (118.78s)
=== RUN   TestAccKubernetesDeployment_generatedName
--- PASS: TestAccKubernetesDeployment_generatedName (27.35s)
=== RUN   TestAccKubernetesDeployment_importGeneratedName
--- PASS: TestAccKubernetesDeployment_importGeneratedName (27.63s)
=== RUN   TestAccKubernetesDeployment_with_security_context
--- PASS: TestAccKubernetesDeployment_with_security_context (17.22s)
=== RUN   TestAccKubernetesDeployment_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesDeployment_with_container_liveness_probe_using_exec (5.01s)
=== RUN   TestAccKubernetesDeployment_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesDeployment_with_container_liveness_probe_using_http_get (5.02s)
=== RUN   TestAccKubernetesDeployment_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesDeployment_with_container_liveness_probe_using_tcp (17.37s)
=== RUN   TestAccKubernetesDeployment_with_container_lifecycle
--- PASS: TestAccKubernetesDeployment_with_container_lifecycle (17.56s)
=== RUN   TestAccKubernetesDeployment_with_container_security_context
--- PASS: TestAccKubernetesDeployment_with_container_security_context (9.12s)
=== RUN   TestAccKubernetesDeployment_with_volume_mount
--- PASS: TestAccKubernetesDeployment_with_volume_mount (5.91s)
=== RUN   TestAccKubernetesDeployment_with_resource_requirements
--- PASS: TestAccKubernetesDeployment_with_resource_requirements (18.06s)
=== RUN   TestAccKubernetesDeployment_with_empty_dir_volume
--- PASS: TestAccKubernetesDeployment_with_empty_dir_volume (1.70s)
=== RUN   TestAccKubernetesDeploymentUpdate_basic
--- PASS: TestAccKubernetesDeploymentUpdate_basic (125.39s)
=== RUN   TestAccKubernetesHorizontalPodAutoscaler_basic
--- PASS: TestAccKubernetesHorizontalPodAutoscaler_basic (2.96s)
=== RUN   TestAccKubernetesHorizontalPodAutoscaler_generatedName
--- PASS: TestAccKubernetesHorizontalPodAutoscaler_generatedName (1.04s)
=== RUN   TestAccKubernetesHorizontalPodAutoscaler_importBasic
--- PASS: TestAccKubernetesHorizontalPodAutoscaler_importBasic (1.16s)
=== RUN   TestAccKubernetesLimitRange_basic
--- PASS: TestAccKubernetesLimitRange_basic (2.70s)
=== RUN   TestAccKubernetesLimitRange_empty
--- PASS: TestAccKubernetesLimitRange_empty (1.02s)
=== RUN   TestAccKubernetesLimitRange_generatedName
--- PASS: TestAccKubernetesLimitRange_generatedName (1.04s)
=== RUN   TestAccKubernetesLimitRange_typeChange
--- PASS: TestAccKubernetesLimitRange_typeChange (1.89s)
=== RUN   TestAccKubernetesLimitRange_multipleLimits
--- PASS: TestAccKubernetesLimitRange_multipleLimits (1.36s)
=== RUN   TestAccKubernetesLimitRange_importBasic
--- PASS: TestAccKubernetesLimitRange_importBasic (1.15s)
=== RUN   TestAccKubernetesNamespace_basic
--- PASS: TestAccKubernetesNamespace_basic (11.53s)
=== RUN   TestAccKubernetesNamespace_invalidLabelValueType
--- PASS: TestAccKubernetesNamespace_invalidLabelValueType (0.03s)
=== RUN   TestAccKubernetesNamespace_importBasic
--- PASS: TestAccKubernetesNamespace_importBasic (8.04s)
=== RUN   TestAccKubernetesNamespace_generatedName
--- PASS: TestAccKubernetesNamespace_generatedName (7.85s)
=== RUN   TestAccKubernetesNamespace_withSpecialCharacters
--- PASS: TestAccKubernetesNamespace_withSpecialCharacters (7.91s)
=== RUN   TestAccKubernetesNamespace_importGeneratedName
--- PASS: TestAccKubernetesNamespace_importGeneratedName (8.04s)
=== RUN   TestAccKubernetesNetworkPolicy_basic
--- PASS: TestAccKubernetesNetworkPolicy_basic (4.26s)
=== RUN   TestAccKubernetesNetworkPolicy_withEgressAtCreation
--- PASS: TestAccKubernetesNetworkPolicy_withEgressAtCreation (1.08s)
=== RUN   TestAccKubernetesNetworkPolicy_importBasic
--- PASS: TestAccKubernetesNetworkPolicy_importBasic (1.14s)
=== RUN   TestAccKubernetesPersistentVolumeClaim_basic
--- PASS: TestAccKubernetesPersistentVolumeClaim_basic (3.83s)
=== RUN   TestAccKubernetesPersistentVolumeClaim_googleCloud_importBasic
--- PASS: TestAccKubernetesPersistentVolumeClaim_googleCloud_importBasic (41.26s)
=== RUN   TestAccKubernetesPersistentVolumeClaim_googleCloud_volumeMatch
--- PASS: TestAccKubernetesPersistentVolumeClaim_googleCloud_volumeMatch (31.46s)
=== RUN   TestAccKubernetesPersistentVolumeClaim_googleCloud_volumeUpdate
--- PASS: TestAccKubernetesPersistentVolumeClaim_googleCloud_volumeUpdate (45.03s)
=== RUN   TestAccKubernetesPersistentVolumeClaim_googleCloud_storageClass
--- PASS: TestAccKubernetesPersistentVolumeClaim_googleCloud_storageClass (13.99s)
=== RUN   TestAccKubernetesPersistentVolume_googleCloud_basic
--- PASS: TestAccKubernetesPersistentVolume_googleCloud_basic (30.45s)
=== RUN   TestAccKubernetesPersistentVolume_aws_basic
--- SKIP: TestAccKubernetesPersistentVolume_aws_basic (0.00s)
    provider_test.go:195: The environment variables AWS_DEFAULT_REGION, AWS_ZONE, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY must be set to run AWS tests - skipping
=== RUN   TestAccKubernetesPersistentVolume_googleCloud_importBasic
--- PASS: TestAccKubernetesPersistentVolume_googleCloud_importBasic (26.94s)
=== RUN   TestAccKubernetesPersistentVolume_googleCloud_volumeSource
--- PASS: TestAccKubernetesPersistentVolume_googleCloud_volumeSource (27.50s)
=== RUN   TestAccKubernetesPersistentVolume_hostPath_volumeSource
--- PASS: TestAccKubernetesPersistentVolume_hostPath_volumeSource (2.73s)
=== RUN   TestAccKubernetesPersistentVolume_local_volumeSource
--- PASS: TestAccKubernetesPersistentVolume_local_volumeSource (2.86s)
=== RUN   TestAccKubernetesPersistentVolume_cephFsSecretRef
--- PASS: TestAccKubernetesPersistentVolume_cephFsSecretRef (1.39s)
=== RUN   TestAccKubernetesPersistentVolume_storageClass
--- PASS: TestAccKubernetesPersistentVolume_storageClass (29.01s)
=== RUN   TestAccKubernetesPersistentVolume_hostPath_nodeAffinity
--- PASS: TestAccKubernetesPersistentVolume_hostPath_nodeAffinity (5.73s)
=== RUN   TestAccKubernetesPod_basic
--- PASS: TestAccKubernetesPod_basic (21.51s)
=== RUN   TestAccKubernetesPod_initContainer_updateForcesNew
--- PASS: TestAccKubernetesPod_initContainer_updateForcesNew (48.23s)
=== RUN   TestAccKubernetesPod_updateArgsForceNew
--- PASS: TestAccKubernetesPod_updateArgsForceNew (91.97s)
=== RUN   TestAccKubernetesPod_updateEnvForceNew
--- PASS: TestAccKubernetesPod_updateEnvForceNew (15.41s)
=== RUN   TestAccKubernetesPod_importBasic
--- PASS: TestAccKubernetesPod_importBasic (13.61s)
=== RUN   TestAccKubernetesPod_with_pod_security_context
--- PASS: TestAccKubernetesPod_with_pod_security_context (19.04s)
=== RUN   TestAccKubernetesPod_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesPod_with_container_liveness_probe_using_exec (49.53s)
=== RUN   TestAccKubernetesPod_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesPod_with_container_liveness_probe_using_http_get (19.01s)
=== RUN   TestAccKubernetesPod_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesPod_with_container_liveness_probe_using_tcp (12.68s)
=== RUN   TestAccKubernetesPod_with_container_lifecycle
--- PASS: TestAccKubernetesPod_with_container_lifecycle (20.94s)
=== RUN   TestAccKubernetesPod_with_container_security_context
--- PASS: TestAccKubernetesPod_with_container_security_context (8.52s)
=== RUN   TestAccKubernetesPod_with_volume_mount
--- PASS: TestAccKubernetesPod_with_volume_mount (7.52s)
=== RUN   TestAccKubernetesPod_with_cfg_map_volume_mount
--- PASS: TestAccKubernetesPod_with_cfg_map_volume_mount (7.56s)
=== RUN   TestAccKubernetesPod_with_resource_requirements
--- PASS: TestAccKubernetesPod_with_resource_requirements (12.96s)
=== RUN   TestAccKubernetesPod_with_empty_dir_volume
--- PASS: TestAccKubernetesPod_with_empty_dir_volume (6.93s)
=== RUN   TestAccKubernetesPod_with_secret_vol_items
--- PASS: TestAccKubernetesPod_with_secret_vol_items (10.81s)
=== RUN   TestAccKubernetesPod_gke_with_nodeSelector
--- PASS: TestAccKubernetesPod_gke_with_nodeSelector (6.92s)
=== RUN   TestAccKubernetesReplicationController_deprecated_basic
--- PASS: TestAccKubernetesReplicationController_deprecated_basic (115.75s)
=== RUN   TestAccKubernetesReplicationController_deprecated_initContainer
--- PASS: TestAccKubernetesReplicationController_deprecated_initContainer (114.86s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importBasic
--- PASS: TestAccKubernetesReplicationController_deprecated_importBasic (114.85s)
=== RUN   TestAccKubernetesReplicationController_deprecated_generatedName
--- PASS: TestAccKubernetesReplicationController_deprecated_generatedName (1.43s)
=== RUN   TestAccKubernetesReplicationController_deprecated_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_deprecated_importGeneratedName (1.47s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_security_context (1.36s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_exec (1.35s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_http_get (1.40s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_liveness_probe_using_tcp (1.37s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_lifecycle (2.07s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_deprecated_with_container_security_context (1.37s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_deprecated_with_volume_mount (2.22s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_deprecated_with_resource_requirements (1.37s)
=== RUN   TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_deprecated_with_empty_dir_volume (1.39s)
=== RUN   TestAccKubernetesReplicationController_basic
--- PASS: TestAccKubernetesReplicationController_basic (115.35s)
=== RUN   TestAccKubernetesReplicationController_initContainer
--- PASS: TestAccKubernetesReplicationController_initContainer (114.84s)
=== RUN   TestAccKubernetesReplicationController_importBasic
--- PASS: TestAccKubernetesReplicationController_importBasic (115.01s)
=== RUN   TestAccKubernetesReplicationController_generatedName
--- PASS: TestAccKubernetesReplicationController_generatedName (1.74s)
=== RUN   TestAccKubernetesReplicationController_importGeneratedName
--- PASS: TestAccKubernetesReplicationController_importGeneratedName (1.48s)
=== RUN   TestAccKubernetesReplicationController_with_security_context
--- PASS: TestAccKubernetesReplicationController_with_security_context (1.38s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_exec (1.40s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_http_get (1.76s)
=== RUN   TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp
--- PASS: TestAccKubernetesReplicationController_with_container_liveness_probe_using_tcp (1.37s)
=== RUN   TestAccKubernetesReplicationController_with_container_lifecycle
--- PASS: TestAccKubernetesReplicationController_with_container_lifecycle (1.41s)
=== RUN   TestAccKubernetesReplicationController_with_container_security_context
--- PASS: TestAccKubernetesReplicationController_with_container_security_context (1.39s)
=== RUN   TestAccKubernetesReplicationController_with_volume_mount
--- PASS: TestAccKubernetesReplicationController_with_volume_mount (2.21s)
=== RUN   TestAccKubernetesReplicationController_with_resource_requirements
--- PASS: TestAccKubernetesReplicationController_with_resource_requirements (1.39s)
=== RUN   TestAccKubernetesReplicationController_with_empty_dir_volume
--- PASS: TestAccKubernetesReplicationController_with_empty_dir_volume (1.42s)
=== RUN   TestAccKubernetesResourceQuota_basic
--- PASS: TestAccKubernetesResourceQuota_basic (3.01s)
=== RUN   TestAccKubernetesResourceQuota_generatedName
--- PASS: TestAccKubernetesResourceQuota_generatedName (1.13s)
=== RUN   TestAccKubernetesResourceQuota_withScopes
--- PASS: TestAccKubernetesResourceQuota_withScopes (2.24s)
=== RUN   TestAccKubernetesResourceQuota_importBasic
--- PASS: TestAccKubernetesResourceQuota_importBasic (1.27s)
=== RUN   TestAccKubernetesRole_basic
--- PASS: TestAccKubernetesRole_basic (1.85s)
=== RUN   TestAccKubernetesRole_importBasic
--- PASS: TestAccKubernetesRole_importBasic (1.14s)
=== RUN   TestAccKubernetesRole_generatedName
--- PASS: TestAccKubernetesRole_generatedName (1.03s)
=== RUN   TestAccKubernetesSecret_basic
--- PASS: TestAccKubernetesSecret_basic (4.69s)
=== RUN   TestAccKubernetesSecret_importBasic
--- PASS: TestAccKubernetesSecret_importBasic (1.14s)
=== RUN   TestAccKubernetesSecret_generatedName
--- PASS: TestAccKubernetesSecret_generatedName (1.10s)
=== RUN   TestAccKubernetesSecret_importGeneratedName
--- PASS: TestAccKubernetesSecret_importGeneratedName (1.19s)
=== RUN   TestAccKubernetesSecret_binaryData
--- PASS: TestAccKubernetesSecret_binaryData (2.00s)
=== RUN   TestAccKubernetesServiceAccount_basic
--- PASS: TestAccKubernetesServiceAccount_basic (1.95s)
=== RUN   TestAccKubernetesServiceAccount_automount
--- PASS: TestAccKubernetesServiceAccount_automount (1.97s)
=== RUN   TestAccKubernetesServiceAccount_update
--- PASS: TestAccKubernetesServiceAccount_update (3.64s)
=== RUN   TestAccKubernetesServiceAccount_generatedName
--- PASS: TestAccKubernetesServiceAccount_generatedName (1.13s)
=== RUN   TestAccKubernetesService_basic
--- PASS: TestAccKubernetesService_basic (1.94s)
=== RUN   TestAccKubernetesService_loadBalancer
--- PASS: TestAccKubernetesService_loadBalancer (58.76s)
=== RUN   TestAccKubernetesService_nodePort
--- PASS: TestAccKubernetesService_nodePort (1.07s)
=== RUN   TestAccKubernetesService_noTargetPort
--- PASS: TestAccKubernetesService_noTargetPort (88.45s)
=== RUN   TestAccKubernetesService_stringTargetPort
--- PASS: TestAccKubernetesService_stringTargetPort (108.87s)
=== RUN   TestAccKubernetesService_externalName
--- PASS: TestAccKubernetesService_externalName (1.25s)
=== RUN   TestAccKubernetesService_importBasic
--- PASS: TestAccKubernetesService_importBasic (1.17s)
=== RUN   TestAccKubernetesService_generatedName
--- PASS: TestAccKubernetesService_generatedName (1.05s)
=== RUN   TestAccKubernetesService_importGeneratedName
--- PASS: TestAccKubernetesService_importGeneratedName (1.17s)
=== RUN   TestAccKubernetesStatefulSet_basic
--- PASS: TestAccKubernetesStatefulSet_basic (1.21s)
=== RUN   TestAccKubernetesStatefulSet_basic_idempotency
--- PASS: TestAccKubernetesStatefulSet_basic_idempotency (1.82s)
=== RUN   TestAccKubernetesStatefulSet_update_image
--- PASS: TestAccKubernetesStatefulSet_update_image (2.12s)
=== RUN   TestAccKubernetesStatefulSet_update_template_selector_labels
--- PASS: TestAccKubernetesStatefulSet_update_template_selector_labels (2.66s)
=== RUN   TestAccKubernetesStatefulSet_update_replicas
--- PASS: TestAccKubernetesStatefulSet_update_replicas (2.05s)
=== RUN   TestAccKubernetesStatefulSet_update_rolling_update_partition
--- PASS: TestAccKubernetesStatefulSet_update_rolling_update_partition (2.16s)
=== RUN   TestAccKubernetesStatefulSet_update_update_strategy_on_delete
--- PASS: TestAccKubernetesStatefulSet_update_update_strategy_on_delete (2.06s)
=== RUN   TestAccKubernetesStatefulSet_update_update_strategy_rolling_update
--- PASS: TestAccKubernetesStatefulSet_update_update_strategy_rolling_update (2.03s)
=== RUN   TestAccKubernetesStatefulSet_update_pod_template_container_port
--- PASS: TestAccKubernetesStatefulSet_update_pod_template_container_port (2.34s)
=== RUN   TestAccKubernetesStorageClass_basic
--- PASS: TestAccKubernetesStorageClass_basic (2.91s)
=== RUN   TestAccKubernetesStorageClass_importBasic
--- PASS: TestAccKubernetesStorageClass_importBasic (1.16s)
=== RUN   TestAccKubernetesStorageClass_generatedName
--- PASS: TestAccKubernetesStorageClass_generatedName (1.05s)
=== RUN   TestAccKubernetesStorageClass_importGeneratedName
--- PASS: TestAccKubernetesStorageClass_importGeneratedName (1.16s)
PASS
ok      github.com/terraform-providers/terraform-provider-kubernetes/kubernetes 2350.358s

@pdecat
Copy link
Contributor Author

pdecat commented Jan 15, 2019

BTW, there is a terraform template in the repo that builds a GKE test environments. It's what our CI also uses, so you get an accurate environment. You find it in kubernetes/test-infra/gke. Just set GCloud creds via env vars and run terraform apply in that folder and you get an acc test setup.

@alexsomesan I also had to run kubectl --user=$KUBE_CTX_AUTH_INFO --cluster=$KUBE_CTX_CLUSTER create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user $(gcloud config get-value account) with kubernetes/test-infra/gke provisioned clusters.

I guess it depends on the google provider version as legacy ABAC is disabled by default since 1.9.0

I'm using version 1.20.0 of the google provider with GKE 1.11.6-gke.2.

Edit: opened #276 to discuss this.

@pdecat pdecat deleted the fix-replication-controller-metadata branch January 16, 2019 13:51
@ghost ghost locked and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kubernetes_replication_controller's template should support metadata in addition to spec
2 participants